fix: Execute deferred constraint triggers when using Prefer: tx=rollback
Resolves #2020
This commit is contained in:
committed by
Steve Chavez
parent
4d64aae870
commit
eda59c241e
Vendored
+14
@@ -2448,3 +2448,17 @@ CREATE TABLE chores (
|
||||
, name text
|
||||
, done bool
|
||||
);
|
||||
|
||||
CREATE TABLE deferrable_unique_constraint (
|
||||
col INT UNIQUE DEFERRABLE INITIALLY IMMEDIATE
|
||||
);
|
||||
|
||||
CREATE FUNCTION raise_constraint(deferred BOOL DEFAULT FALSE) RETURNS void
|
||||
LANGUAGE plpgsql AS $$
|
||||
BEGIN
|
||||
IF deferred THEN
|
||||
SET CONSTRAINTS ALL DEFERRED;
|
||||
END IF;
|
||||
|
||||
INSERT INTO deferrable_unique_constraint VALUES (1), (1);
|
||||
END$$;
|
||||
|
||||
Reference in New Issue
Block a user