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

Commit04b3160

Browse files
committed
Add 'ONLY' to queries generated by RI triggers, so as to preserve pre-7.1
semantics of RI operations. Eventually we ought to look at making RIwork properly across inheritance trees, but not for 7.1 ...
1 parentf4eef66 commit04b3160

File tree

1 file changed

+25
-25
lines changed

1 file changed

+25
-25
lines changed

‎src/backend/utils/adt/ri_triggers.c

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*
77
*1999 Jan Wieck
88
*
9-
* $Header: /cvsroot/pgsql/src/backend/utils/adt/ri_triggers.c,v 1.19 2000/11/21 04:01:09inoue Exp $
9+
* $Header: /cvsroot/pgsql/src/backend/utils/adt/ri_triggers.c,v 1.20 2000/12/22 18:35:09tgl Exp $
1010
*
1111
* ----------
1212
*/
@@ -232,10 +232,10 @@ RI_FKey_check(PG_FUNCTION_ARGS)
232232

233233
/* ----------
234234
* The query string built is
235-
*SELECT oid FROM <pktable>
235+
*SELECT oid FROMONLY<pktable>
236236
* ----------
237237
*/
238-
sprintf(querystr,"SELECT oid FROM \"%s\" FOR UPDATE OF \"%s\"",
238+
sprintf(querystr,"SELECT oid FROMONLY\"%s\" FOR UPDATE OF \"%s\"",
239239
tgargs[RI_PK_RELNAME_ARGNO],
240240
tgargs[RI_PK_RELNAME_ARGNO]);
241241

@@ -381,14 +381,14 @@ RI_FKey_check(PG_FUNCTION_ARGS)
381381

382382
/* ----------
383383
* The query string built is
384-
*SELECT oid FROM <pktable> WHERE pkatt1 = $1 [AND ...]
384+
*SELECT oid FROMONLY<pktable> WHERE pkatt1 = $1 [AND ...]
385385
* The type id's for the $ parameters are those of the
386386
* corresponding FK attributes. Thus, SPI_prepare could
387387
* eventually fail if the parser cannot identify some way
388388
* how to compare these two types by '='.
389389
* ----------
390390
*/
391-
sprintf(querystr,"SELECT oid FROM \"%s\"",
391+
sprintf(querystr,"SELECT oid FROMONLY\"%s\"",
392392
tgargs[RI_PK_RELNAME_ARGNO]);
393393
querysep="WHERE";
394394
for (i=0;i<qkey.nkeypairs;i++)
@@ -623,14 +623,14 @@ RI_FKey_noaction_del(PG_FUNCTION_ARGS)
623623

624624
/* ----------
625625
* The query string built is
626-
*SELECT oid FROM <fktable> WHERE fkatt1 = $1 [AND ...]
626+
*SELECT oid FROMONLY<fktable> WHERE fkatt1 = $1 [AND ...]
627627
* The type id's for the $ parameters are those of the
628628
* corresponding PK attributes. Thus, SPI_prepare could
629629
* eventually fail if the parser cannot identify some way
630630
* how to compare these two types by '='.
631631
* ----------
632632
*/
633-
sprintf(querystr,"SELECT oid FROM \"%s\"",
633+
sprintf(querystr,"SELECT oid FROMONLY\"%s\"",
634634
tgargs[RI_FK_RELNAME_ARGNO]);
635635
querysep="WHERE";
636636
for (i=0;i<qkey.nkeypairs;i++)
@@ -847,14 +847,14 @@ RI_FKey_noaction_upd(PG_FUNCTION_ARGS)
847847

848848
/* ----------
849849
* The query string built is
850-
*SELECT oid FROM <fktable> WHERE fkatt1 = $1 [AND ...]
850+
*SELECT oid FROMONLY<fktable> WHERE fkatt1 = $1 [AND ...]
851851
* The type id's for the $ parameters are those of the
852852
* corresponding PK attributes. Thus, SPI_prepare could
853853
* eventually fail if the parser cannot identify some way
854854
* how to compare these two types by '='.
855855
* ----------
856856
*/
857-
sprintf(querystr,"SELECT oid FROM \"%s\"",
857+
sprintf(querystr,"SELECT oid FROMONLY\"%s\"",
858858
tgargs[RI_FK_RELNAME_ARGNO]);
859859
querysep="WHERE";
860860
for (i=0;i<qkey.nkeypairs;i++)
@@ -1055,14 +1055,14 @@ RI_FKey_cascade_del(PG_FUNCTION_ARGS)
10551055

10561056
/* ----------
10571057
* The query string built is
1058-
*DELETE FROM <fktable> WHERE fkatt1 = $1 [AND ...]
1058+
*DELETE FROMONLY<fktable> WHERE fkatt1 = $1 [AND ...]
10591059
* The type id's for the $ parameters are those of the
10601060
* corresponding PK attributes. Thus, SPI_prepare could
10611061
* eventually fail if the parser cannot identify some way
10621062
* how to compare these two types by '='.
10631063
* ----------
10641064
*/
1065-
sprintf(querystr,"DELETE FROM \"%s\"",
1065+
sprintf(querystr,"DELETE FROMONLY\"%s\"",
10661066
tgargs[RI_FK_RELNAME_ARGNO]);
10671067
querysep="WHERE";
10681068
for (i=0;i<qkey.nkeypairs;i++)
@@ -1263,15 +1263,15 @@ RI_FKey_cascade_upd(PG_FUNCTION_ARGS)
12631263

12641264
/* ----------
12651265
* The query string built is
1266-
*UPDATE <fktable> SET fkatt1 = $1 [, ...]
1266+
*UPDATEONLY<fktable> SET fkatt1 = $1 [, ...]
12671267
*WHERE fkatt1 = $n [AND ...]
12681268
* The type id's for the $ parameters are those of the
12691269
* corresponding PK attributes. Thus, SPI_prepare could
12701270
* eventually fail if the parser cannot identify some way
12711271
* how to compare these two types by '='.
12721272
* ----------
12731273
*/
1274-
sprintf(querystr,"UPDATE \"%s\" SET",
1274+
sprintf(querystr,"UPDATEONLY\"%s\" SET",
12751275
tgargs[RI_FK_RELNAME_ARGNO]);
12761276
qualstr[0]='\0';
12771277
querysep="";
@@ -1483,14 +1483,14 @@ RI_FKey_restrict_del(PG_FUNCTION_ARGS)
14831483

14841484
/* ----------
14851485
* The query string built is
1486-
*SELECT oid FROM <fktable> WHERE fkatt1 = $1 [AND ...]
1486+
*SELECT oid FROMONLY<fktable> WHERE fkatt1 = $1 [AND ...]
14871487
* The type id's for the $ parameters are those of the
14881488
* corresponding PK attributes. Thus, SPI_prepare could
14891489
* eventually fail if the parser cannot identify some way
14901490
* how to compare these two types by '='.
14911491
* ----------
14921492
*/
1493-
sprintf(querystr,"SELECT oid FROM \"%s\"",
1493+
sprintf(querystr,"SELECT oid FROMONLY\"%s\"",
14941494
tgargs[RI_FK_RELNAME_ARGNO]);
14951495
querysep="WHERE";
14961496
for (i=0;i<qkey.nkeypairs;i++)
@@ -1708,14 +1708,14 @@ RI_FKey_restrict_upd(PG_FUNCTION_ARGS)
17081708

17091709
/* ----------
17101710
* The query string built is
1711-
*SELECT oid FROM <fktable> WHERE fkatt1 = $1 [AND ...]
1711+
*SELECT oid FROMONLY<fktable> WHERE fkatt1 = $1 [AND ...]
17121712
* The type id's for the $ parameters are those of the
17131713
* corresponding PK attributes. Thus, SPI_prepare could
17141714
* eventually fail if the parser cannot identify some way
17151715
* how to compare these two types by '='.
17161716
* ----------
17171717
*/
1718-
sprintf(querystr,"SELECT oid FROM \"%s\"",
1718+
sprintf(querystr,"SELECT oid FROMONLY\"%s\"",
17191719
tgargs[RI_FK_RELNAME_ARGNO]);
17201720
querysep="WHERE";
17211721
for (i=0;i<qkey.nkeypairs;i++)
@@ -1919,15 +1919,15 @@ RI_FKey_setnull_del(PG_FUNCTION_ARGS)
19191919

19201920
/* ----------
19211921
* The query string built is
1922-
*UPDATE <fktable> SET fkatt1 = NULL [, ...]
1922+
*UPDATEONLY<fktable> SET fkatt1 = NULL [, ...]
19231923
*WHERE fkatt1 = $1 [AND ...]
19241924
* The type id's for the $ parameters are those of the
19251925
* corresponding PK attributes. Thus, SPI_prepare could
19261926
* eventually fail if the parser cannot identify some way
19271927
* how to compare these two types by '='.
19281928
* ----------
19291929
*/
1930-
sprintf(querystr,"UPDATE \"%s\" SET",
1930+
sprintf(querystr,"UPDATEONLY\"%s\" SET",
19311931
tgargs[RI_FK_RELNAME_ARGNO]);
19321932
qualstr[0]='\0';
19331933
querysep="";
@@ -2157,15 +2157,15 @@ RI_FKey_setnull_upd(PG_FUNCTION_ARGS)
21572157

21582158
/* ----------
21592159
* The query string built is
2160-
*UPDATE <fktable> SET fkatt1 = NULL [, ...]
2160+
*UPDATEONLY<fktable> SET fkatt1 = NULL [, ...]
21612161
*WHERE fkatt1 = $1 [AND ...]
21622162
* The type id's for the $ parameters are those of the
21632163
* corresponding PK attributes. Thus, SPI_prepare could
21642164
* eventually fail if the parser cannot identify some way
21652165
* how to compare these two types by '='.
21662166
* ----------
21672167
*/
2168-
sprintf(querystr,"UPDATE \"%s\" SET",
2168+
sprintf(querystr,"UPDATEONLY\"%s\" SET",
21692169
tgargs[RI_FK_RELNAME_ARGNO]);
21702170
qualstr[0]='\0';
21712171
querysep="";
@@ -2385,15 +2385,15 @@ RI_FKey_setdefault_del(PG_FUNCTION_ARGS)
23852385

23862386
/* ----------
23872387
* The query string built is
2388-
*UPDATE <fktable> SET fkatt1 = NULL [, ...]
2388+
*UPDATEONLY<fktable> SET fkatt1 = NULL [, ...]
23892389
*WHERE fkatt1 = $1 [AND ...]
23902390
* The type id's for the $ parameters are those of the
23912391
* corresponding PK attributes. Thus, SPI_prepare could
23922392
* eventually fail if the parser cannot identify some way
23932393
* how to compare these two types by '='.
23942394
* ----------
23952395
*/
2396-
sprintf(querystr,"UPDATE \"%s\" SET",
2396+
sprintf(querystr,"UPDATEONLY\"%s\" SET",
23972397
tgargs[RI_FK_RELNAME_ARGNO]);
23982398
qualstr[0]='\0';
23992399
querysep="";
@@ -2651,15 +2651,15 @@ RI_FKey_setdefault_upd(PG_FUNCTION_ARGS)
26512651

26522652
/* ----------
26532653
* The query string built is
2654-
*UPDATE <fktable> SET fkatt1 = NULL [, ...]
2654+
*UPDATEONLY<fktable> SET fkatt1 = NULL [, ...]
26552655
*WHERE fkatt1 = $1 [AND ...]
26562656
* The type id's for the $ parameters are those of the
26572657
* corresponding PK attributes. Thus, SPI_prepare could
26582658
* eventually fail if the parser cannot identify some way
26592659
* how to compare these two types by '='.
26602660
* ----------
26612661
*/
2662-
sprintf(querystr,"UPDATE \"%s\" SET",
2662+
sprintf(querystr,"UPDATEONLY\"%s\" SET",
26632663
tgargs[RI_FK_RELNAME_ARGNO]);
26642664
qualstr[0]='\0';
26652665
querysep="";

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp