Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
56f87688
Commit
56f87688
authored
Jul 22, 2003
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Error message editing for foreign-key triggers.
parent
fe5de484
Changes
5
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
280 additions
and
319 deletions
+280
-319
src/backend/utils/adt/ri_triggers.c
src/backend/utils/adt/ri_triggers.c
+212
-284
src/include/utils/elog.h
src/include/utils/elog.h
+2
-2
src/test/regress/expected/alter_table.out
src/test/regress/expected/alter_table.out
+2
-1
src/test/regress/expected/cluster.out
src/test/regress/expected/cluster.out
+2
-1
src/test/regress/expected/foreign_key.out
src/test/regress/expected/foreign_key.out
+62
-31
No files found.
src/backend/utils/adt/ri_triggers.c
View file @
56f87688
This diff is collapsed.
Click to expand it.
src/include/utils/elog.h
View file @
56f87688
...
...
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: elog.h,v 1.5
4 2003/07/22 19:00:12
tgl Exp $
* $Id: elog.h,v 1.5
5 2003/07/22 22:14:57
tgl Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -162,7 +162,7 @@
#define ERRCODE_INTEGRITY_CONSTRAINT_VIOLATION MAKE_SQLSTATE('2','3', '0','0','0')
#define ERRCODE_RESTRICT_VIOLATION MAKE_SQLSTATE('2','3', '0','0','1')
#define ERRCODE_NOT_NULL_VIOLATION MAKE_SQLSTATE('2','3', '5','0','2')
#define ERRCODE_FOREIGN_KEY_V
ALUE_NOT_FOUND
MAKE_SQLSTATE('2','3', '5','0','3')
#define ERRCODE_FOREIGN_KEY_V
IOLATION
MAKE_SQLSTATE('2','3', '5','0','3')
#define ERRCODE_UNIQUE_VIOLATION MAKE_SQLSTATE('2','3', '5','0','5')
#define ERRCODE_CHECK_VIOLATION MAKE_SQLSTATE('2','3', '5','1','4')
...
...
src/test/regress/expected/alter_table.out
View file @
56f87688
...
...
@@ -316,7 +316,8 @@ ERROR: column "b" referenced in foreign key constraint does not exist
-- Try (and fail) to add constraint due to invalid data
ALTER TABLE tmp3 add constraint tmpconstr foreign key (a) references tmp2 match full;
NOTICE: ALTER TABLE will create implicit trigger(s) for FOREIGN KEY check(s)
ERROR: tmpconstr referential integrity violation - key (a)=(5) referenced from tmp3 not found in tmp2
ERROR: insert or update on "tmp3" violates foreign key constraint "tmpconstr"
DETAIL: Key (a)=(5) is not present in "tmp2".
-- Delete failing row
DELETE FROM tmp3 where a=5;
-- Try (and succeed)
...
...
src/test/regress/expected/cluster.out
View file @
56f87688
...
...
@@ -248,7 +248,8 @@ SELECT a,b,c,substring(d for 30), length(d) from clstr_tst;
-- Verify that foreign key link still works
INSERT INTO clstr_tst (b, c) VALUES (1111, 'this should fail');
ERROR: clstr_tst_con referential integrity violation - key (b)=(1111) referenced from clstr_tst not found in clstr_tst_s
ERROR: insert or update on "clstr_tst" violates foreign key constraint "clstr_tst_con"
DETAIL: Key (b)=(1111) is not present in "clstr_tst_s".
SELECT conname FROM pg_constraint WHERE conrelid = 'clstr_tst'::regclass;
conname
----------------
...
...
src/test/regress/expected/foreign_key.out
View file @
56f87688
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment