Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
postgres-lambda-diff
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jakob Huber
postgres-lambda-diff
Commits
b6c881ce
Commit
b6c881ce
authored
19 years ago
by
Bruce Momjian
Browse files
Options
Downloads
Patches
Plain Diff
Update regression tests for new referential integrity error message
wording ("table" added).
parent
c104cd20
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/test/regress/expected/foreign_key.out
+10
-10
10 additions, 10 deletions
src/test/regress/expected/foreign_key.out
with
10 additions
and
10 deletions
src/test/regress/expected/foreign_key.out
+
10
−
10
View file @
b6c881ce
...
...
@@ -307,7 +307,7 @@ SELECT * FROM PKTABLE;
-- Delete a row from PK TABLE (should fail)
DELETE FROM PKTABLE WHERE ptest1=1;
ERROR: update or delete on "pktable" violates foreign key constraint "fktable_ftest1_fkey" on "fktable"
ERROR: update or delete on
table
"pktable" violates foreign key constraint "fktable_ftest1_fkey" on
table
"fktable"
DETAIL: Key (ptest1)=(1) is still referenced from table "fktable".
-- Delete a row from PK TABLE (should succeed)
DELETE FROM PKTABLE WHERE ptest1=5;
...
...
@@ -323,7 +323,7 @@ SELECT * FROM PKTABLE;
-- Update a row from PK TABLE (should fail)
UPDATE PKTABLE SET ptest1=0 WHERE ptest1=2;
ERROR: update or delete on "pktable" violates foreign key constraint "fktable_ftest1_fkey" on "fktable"
ERROR: update or delete on
table
"pktable" violates foreign key constraint "fktable_ftest1_fkey" on
table
"fktable"
DETAIL: Key (ptest1)=(2) is still referenced from table "fktable".
-- Update a row from PK TABLE (should succeed)
UPDATE PKTABLE SET ptest1=0 WHERE ptest1=4;
...
...
@@ -373,13 +373,13 @@ SELECT * from FKTABLE;
-- Try to update something that should fail
UPDATE PKTABLE set ptest2=5 where ptest2=2;
ERROR: update or delete on "pktable" violates foreign key constraint "constrname3" on "fktable"
ERROR: update or delete on
table
"pktable" violates foreign key constraint "constrname3" on
table
"fktable"
DETAIL: Key (ptest1,ptest2,ptest3)=(1,2,3) is still referenced from table "fktable".
-- Try to update something that should succeed
UPDATE PKTABLE set ptest1=1 WHERE ptest2=3;
-- Try to delete something that should fail
DELETE FROM PKTABLE where ptest1=1 and ptest2=2 and ptest3=3;
ERROR: update or delete on "pktable" violates foreign key constraint "constrname3" on "fktable"
ERROR: update or delete on
table
"pktable" violates foreign key constraint "constrname3" on
table
"fktable"
DETAIL: Key (ptest1,ptest2,ptest3)=(1,2,3) is still referenced from table "fktable".
-- Try to delete something that should work
DELETE FROM PKTABLE where ptest1=2;
...
...
@@ -849,12 +849,12 @@ insert into pktable(base1) values (3);
insert into fktable(ftest1) values (3);
-- let's try removing a row that should fail from pktable
delete from pktable where base1>2;
ERROR: update or delete on "pktable" violates foreign key constraint "fktable_ftest1_fkey" on "fktable"
ERROR: update or delete on
table
"pktable" violates foreign key constraint "fktable_ftest1_fkey" on
table
"fktable"
DETAIL: Key (base1)=(3) is still referenced from table "fktable".
-- okay, let's try updating all of the base1 values to *4
-- which should fail.
update pktable set base1=base1*4;
ERROR: update or delete on "pktable" violates foreign key constraint "fktable_ftest1_fkey" on "fktable"
ERROR: update or delete on
table
"pktable" violates foreign key constraint "fktable_ftest1_fkey" on
table
"fktable"
DETAIL: Key (base1)=(3) is still referenced from table "fktable".
-- okay, let's try an update that should work.
update pktable set base1=base1*4 where base1<3;
...
...
@@ -877,12 +877,12 @@ insert into pktable(base1,ptest1) values (3, 1);
insert into fktable(ftest1, ftest2) values (3, 1);
-- let's try removing a row that should fail from pktable
delete from pktable where base1>2;
ERROR: update or delete on "pktable" violates foreign key constraint "fktable_ftest1_fkey" on "fktable"
ERROR: update or delete on
table
"pktable" violates foreign key constraint "fktable_ftest1_fkey" on
table
"fktable"
DETAIL: Key (base1,ptest1)=(3,1) is still referenced from table "fktable".
-- okay, let's try updating all of the base1 values to *4
-- which should fail.
update pktable set base1=base1*4;
ERROR: update or delete on "pktable" violates foreign key constraint "fktable_ftest1_fkey" on "fktable"
ERROR: update or delete on
table
"pktable" violates foreign key constraint "fktable_ftest1_fkey" on
table
"fktable"
DETAIL: Key (base1,ptest1)=(3,1) is still referenced from table "fktable".
-- okay, let's try an update that should work.
update pktable set base1=base1*4 where base1<3;
...
...
@@ -907,11 +907,11 @@ ERROR: insert or update on table "pktable" violates foreign key constraint "pkt
DETAIL: Key (base2,ptest2)=(3,2) is not present in table "pktable".
-- fails (2,2) is being referenced
delete from pktable where base1=2;
ERROR: update or delete on "pktable" violates foreign key constraint "pktable_base2_fkey" on "pktable"
ERROR: update or delete on
table
"pktable" violates foreign key constraint "pktable_base2_fkey" on
table
"pktable"
DETAIL: Key (base1,ptest1)=(2,2) is still referenced from table "pktable".
-- fails (1,1) is being referenced (twice)
update pktable set base1=3 where base1=1;
ERROR: update or delete on "pktable" violates foreign key constraint "pktable_base2_fkey" on "pktable"
ERROR: update or delete on
table
"pktable" violates foreign key constraint "pktable_base2_fkey" on
table
"pktable"
DETAIL: Key (base1,ptest1)=(1,1) is still referenced from table "pktable".
-- this sequence of two deletes will work, since after the first there will be no (2,*) references
delete from pktable where base2=2;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment