Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5b806ec

Browse files
committed
Remove NOTICE about foreign key creating implicit triggers, because it no
longer conveys useful information.
1 parent08c33c4 commit5b806ec

File tree

5 files changed

+1
-67
lines changed

5 files changed

+1
-67
lines changed

‎src/backend/parser/analyze.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
77
* Portions Copyright (c) 1994, Regents of the University of California
88
*
9-
*$Header: /cvsroot/pgsql/src/backend/parser/analyze.c,v 1.289 2003/09/26 15:27:32 petere Exp $
9+
*$Header: /cvsroot/pgsql/src/backend/parser/analyze.c,v 1.290 2003/10/02 06:32:45 petere Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -1565,10 +1565,6 @@ transformFKConstraints(ParseState *pstate, CreateStmtContext *cxt,
15651565
if (cxt->fkconstraints==NIL)
15661566
return;
15671567

1568-
ereport(NOTICE,
1569-
(errmsg("%s will create implicit triggers for foreign-key checks",
1570-
cxt->stmtType)));
1571-
15721568
/*
15731569
* For ALTER TABLE ADD CONSTRAINT, nothing to do. For CREATE TABLE or
15741570
* ALTER TABLE ADD COLUMN, gin up an ALTER TABLE ADD CONSTRAINT

‎src/test/regress/expected/alter_table.out

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -307,26 +307,21 @@ INSERT INTO tmp3 values (1,20);
307307
INSERT INTO tmp3 values (5,50);
308308
-- Try (and fail) to add constraint due to invalid source columns
309309
ALTER TABLE tmp3 add constraint tmpconstr foreign key(c) references tmp2 match full;
310-
NOTICE: ALTER TABLE will create implicit triggers for foreign-key checks
311310
ERROR: column "c" referenced in foreign key constraint does not exist
312311
-- Try (and fail) to add constraint due to invalide destination columns explicitly given
313312
ALTER TABLE tmp3 add constraint tmpconstr foreign key(a) references tmp2(b) match full;
314-
NOTICE: ALTER TABLE will create implicit triggers for foreign-key checks
315313
ERROR: column "b" referenced in foreign key constraint does not exist
316314
-- Try (and fail) to add constraint due to invalid data
317315
ALTER TABLE tmp3 add constraint tmpconstr foreign key (a) references tmp2 match full;
318-
NOTICE: ALTER TABLE will create implicit triggers for foreign-key checks
319316
ERROR: insert or update on table "tmp3" violates foreign key constraint "tmpconstr"
320317
DETAIL: Key (a)=(5) is not present in table "tmp2".
321318
-- Delete failing row
322319
DELETE FROM tmp3 where a=5;
323320
-- Try (and succeed)
324321
ALTER TABLE tmp3 add constraint tmpconstr foreign key (a) references tmp2 match full;
325-
NOTICE: ALTER TABLE will create implicit triggers for foreign-key checks
326322
-- Try (and fail) to create constraint from tmp5(a) to tmp4(a) - unique constraint on
327323
-- tmp4 is a,b
328324
ALTER TABLE tmp5 add constraint tmpconstr foreign key(a) references tmp4(a) match full;
329-
NOTICE: ALTER TABLE will create implicit triggers for foreign-key checks
330325
ERROR: there is no unique constraint matching given keys for referenced table "tmp4"
331326
DROP TABLE tmp5;
332327
DROP TABLE tmp4;
@@ -340,24 +335,20 @@ NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "pktable_pkey" fo
340335
CREATE TEMP TABLE FKTABLE (ftest1 inet);
341336
-- This next should fail, because inet=int does not exist
342337
ALTER TABLE FKTABLE ADD FOREIGN KEY(ftest1) references pktable;
343-
NOTICE: ALTER TABLE will create implicit triggers for foreign-key checks
344338
ERROR: operator does not exist: inet = integer
345339
HINT: No operator matches the given name and argument type(s). You may need to add explicit type casts.
346340
-- This should also fail for the same reason, but here we
347341
-- give the column name
348342
ALTER TABLE FKTABLE ADD FOREIGN KEY(ftest1) references pktable(ptest1);
349-
NOTICE: ALTER TABLE will create implicit triggers for foreign-key checks
350343
ERROR: operator does not exist: inet = integer
351344
HINT: No operator matches the given name and argument type(s). You may need to add explicit type casts.
352345
-- This should succeed, even though they are different types
353346
-- because varchar=int does exist
354347
DROP TABLE FKTABLE;
355348
CREATE TEMP TABLE FKTABLE (ftest1 varchar);
356349
ALTER TABLE FKTABLE ADD FOREIGN KEY(ftest1) references pktable;
357-
NOTICE: ALTER TABLE will create implicit triggers for foreign-key checks
358350
-- As should this
359351
ALTER TABLE FKTABLE ADD FOREIGN KEY(ftest1) references pktable(ptest1);
360-
NOTICE: ALTER TABLE will create implicit triggers for foreign-key checks
361352
DROP TABLE pktable cascade;
362353
NOTICE: drop cascades to constraint $2 on table fktable
363354
NOTICE: drop cascades to constraint $1 on table fktable
@@ -368,29 +359,25 @@ NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "pktable_pkey" fo
368359
-- This should fail, because we just chose really odd types
369360
CREATE TEMP TABLE FKTABLE (ftest1 cidr, ftest2 timestamp);
370361
ALTER TABLE FKTABLE ADD FOREIGN KEY(ftest1, ftest2) references pktable;
371-
NOTICE: ALTER TABLE will create implicit triggers for foreign-key checks
372362
ERROR: operator does not exist: cidr = integer
373363
HINT: No operator matches the given name and argument type(s). You may need to add explicit type casts.
374364
DROP TABLE FKTABLE;
375365
-- Again, so should this...
376366
CREATE TEMP TABLE FKTABLE (ftest1 cidr, ftest2 timestamp);
377367
ALTER TABLE FKTABLE ADD FOREIGN KEY(ftest1, ftest2)
378368
references pktable(ptest1, ptest2);
379-
NOTICE: ALTER TABLE will create implicit triggers for foreign-key checks
380369
ERROR: operator does not exist: cidr = integer
381370
HINT: No operator matches the given name and argument type(s). You may need to add explicit type casts.
382371
DROP TABLE FKTABLE;
383372
-- This fails because we mixed up the column ordering
384373
CREATE TEMP TABLE FKTABLE (ftest1 int, ftest2 inet);
385374
ALTER TABLE FKTABLE ADD FOREIGN KEY(ftest1, ftest2)
386375
references pktable(ptest2, ptest1);
387-
NOTICE: ALTER TABLE will create implicit triggers for foreign-key checks
388376
ERROR: operator does not exist: integer = inet
389377
HINT: No operator matches the given name and argument type(s). You may need to add explicit type casts.
390378
-- As does this...
391379
ALTER TABLE FKTABLE ADD FOREIGN KEY(ftest2, ftest1)
392380
references pktable(ptest1, ptest2);
393-
NOTICE: ALTER TABLE will create implicit triggers for foreign-key checks
394381
ERROR: operator does not exist: inet = integer
395382
HINT: No operator matches the given name and argument type(s). You may need to add explicit type casts.
396383
-- temp tables should go away by themselves, need not drop them.
@@ -907,16 +894,12 @@ ERROR: column "........pg.dropped.1........" does not exist
907894
create table atacc2 (id int4 unique);
908895
NOTICE: CREATE TABLE / UNIQUE will create implicit index "atacc2_id_key" for table "atacc2"
909896
alter table atacc1 add foreign key (a) references atacc2(id);
910-
NOTICE: ALTER TABLE will create implicit triggers for foreign-key checks
911897
ERROR: column "a" referenced in foreign key constraint does not exist
912898
alter table atacc1 add foreign key ("........pg.dropped.1........") references atacc2(id);
913-
NOTICE: ALTER TABLE will create implicit triggers for foreign-key checks
914899
ERROR: column "........pg.dropped.1........" referenced in foreign key constraint does not exist
915900
alter table atacc2 add foreign key (id) references atacc1(a);
916-
NOTICE: ALTER TABLE will create implicit triggers for foreign-key checks
917901
ERROR: column "a" referenced in foreign key constraint does not exist
918902
alter table atacc2 add foreign key (id) references atacc1("........pg.dropped.1........");
919-
NOTICE: ALTER TABLE will create implicit triggers for foreign-key checks
920903
ERROR: column "........pg.dropped.1........" referenced in foreign key constraint does not exist
921904
drop table atacc2;
922905
create index "testing_idx" on atacc1(a);

‎src/test/regress/expected/cluster.out

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ CREATE TABLE clstr_tst (a SERIAL PRIMARY KEY,
1212
CONSTRAINT clstr_tst_con FOREIGN KEY (b) REFERENCES clstr_tst_s);
1313
NOTICE: CREATE TABLE will create implicit sequence "clstr_tst_a_seq" for "serial" column "clstr_tst.a"
1414
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "clstr_tst_pkey" for table "clstr_tst"
15-
NOTICE: CREATE TABLE will create implicit triggers for foreign-key checks
1615
CREATE INDEX clstr_tst_b ON clstr_tst (b);
1716
CREATE INDEX clstr_tst_c ON clstr_tst (c);
1817
CREATE INDEX clstr_tst_c_b ON clstr_tst (c,b);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp