|
6 | 6 | * |
7 | 7 | *1999 Jan Wieck |
8 | 8 | * |
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 $ |
10 | 10 | * |
11 | 11 | * ---------- |
12 | 12 | */ |
@@ -232,10 +232,10 @@ RI_FKey_check(PG_FUNCTION_ARGS) |
232 | 232 |
|
233 | 233 | /* ---------- |
234 | 234 | * The query string built is |
235 | | - *SELECT oid FROM <pktable> |
| 235 | + *SELECT oid FROMONLY<pktable> |
236 | 236 | * ---------- |
237 | 237 | */ |
238 | | -sprintf(querystr,"SELECT oid FROM \"%s\" FOR UPDATE OF \"%s\"", |
| 238 | +sprintf(querystr,"SELECT oid FROMONLY\"%s\" FOR UPDATE OF \"%s\"", |
239 | 239 | tgargs[RI_PK_RELNAME_ARGNO], |
240 | 240 | tgargs[RI_PK_RELNAME_ARGNO]); |
241 | 241 |
|
@@ -381,14 +381,14 @@ RI_FKey_check(PG_FUNCTION_ARGS) |
381 | 381 |
|
382 | 382 | /* ---------- |
383 | 383 | * The query string built is |
384 | | - *SELECT oid FROM <pktable> WHERE pkatt1 = $1 [AND ...] |
| 384 | + *SELECT oid FROMONLY<pktable> WHERE pkatt1 = $1 [AND ...] |
385 | 385 | * The type id's for the $ parameters are those of the |
386 | 386 | * corresponding FK attributes. Thus, SPI_prepare could |
387 | 387 | * eventually fail if the parser cannot identify some way |
388 | 388 | * how to compare these two types by '='. |
389 | 389 | * ---------- |
390 | 390 | */ |
391 | | -sprintf(querystr,"SELECT oid FROM \"%s\"", |
| 391 | +sprintf(querystr,"SELECT oid FROMONLY\"%s\"", |
392 | 392 | tgargs[RI_PK_RELNAME_ARGNO]); |
393 | 393 | querysep="WHERE"; |
394 | 394 | for (i=0;i<qkey.nkeypairs;i++) |
@@ -623,14 +623,14 @@ RI_FKey_noaction_del(PG_FUNCTION_ARGS) |
623 | 623 |
|
624 | 624 | /* ---------- |
625 | 625 | * The query string built is |
626 | | - *SELECT oid FROM <fktable> WHERE fkatt1 = $1 [AND ...] |
| 626 | + *SELECT oid FROMONLY<fktable> WHERE fkatt1 = $1 [AND ...] |
627 | 627 | * The type id's for the $ parameters are those of the |
628 | 628 | * corresponding PK attributes. Thus, SPI_prepare could |
629 | 629 | * eventually fail if the parser cannot identify some way |
630 | 630 | * how to compare these two types by '='. |
631 | 631 | * ---------- |
632 | 632 | */ |
633 | | -sprintf(querystr,"SELECT oid FROM \"%s\"", |
| 633 | +sprintf(querystr,"SELECT oid FROMONLY\"%s\"", |
634 | 634 | tgargs[RI_FK_RELNAME_ARGNO]); |
635 | 635 | querysep="WHERE"; |
636 | 636 | for (i=0;i<qkey.nkeypairs;i++) |
@@ -847,14 +847,14 @@ RI_FKey_noaction_upd(PG_FUNCTION_ARGS) |
847 | 847 |
|
848 | 848 | /* ---------- |
849 | 849 | * The query string built is |
850 | | - *SELECT oid FROM <fktable> WHERE fkatt1 = $1 [AND ...] |
| 850 | + *SELECT oid FROMONLY<fktable> WHERE fkatt1 = $1 [AND ...] |
851 | 851 | * The type id's for the $ parameters are those of the |
852 | 852 | * corresponding PK attributes. Thus, SPI_prepare could |
853 | 853 | * eventually fail if the parser cannot identify some way |
854 | 854 | * how to compare these two types by '='. |
855 | 855 | * ---------- |
856 | 856 | */ |
857 | | -sprintf(querystr,"SELECT oid FROM \"%s\"", |
| 857 | +sprintf(querystr,"SELECT oid FROMONLY\"%s\"", |
858 | 858 | tgargs[RI_FK_RELNAME_ARGNO]); |
859 | 859 | querysep="WHERE"; |
860 | 860 | for (i=0;i<qkey.nkeypairs;i++) |
@@ -1055,14 +1055,14 @@ RI_FKey_cascade_del(PG_FUNCTION_ARGS) |
1055 | 1055 |
|
1056 | 1056 | /* ---------- |
1057 | 1057 | * The query string built is |
1058 | | - *DELETE FROM <fktable> WHERE fkatt1 = $1 [AND ...] |
| 1058 | + *DELETE FROMONLY<fktable> WHERE fkatt1 = $1 [AND ...] |
1059 | 1059 | * The type id's for the $ parameters are those of the |
1060 | 1060 | * corresponding PK attributes. Thus, SPI_prepare could |
1061 | 1061 | * eventually fail if the parser cannot identify some way |
1062 | 1062 | * how to compare these two types by '='. |
1063 | 1063 | * ---------- |
1064 | 1064 | */ |
1065 | | -sprintf(querystr,"DELETE FROM \"%s\"", |
| 1065 | +sprintf(querystr,"DELETE FROMONLY\"%s\"", |
1066 | 1066 | tgargs[RI_FK_RELNAME_ARGNO]); |
1067 | 1067 | querysep="WHERE"; |
1068 | 1068 | for (i=0;i<qkey.nkeypairs;i++) |
@@ -1263,15 +1263,15 @@ RI_FKey_cascade_upd(PG_FUNCTION_ARGS) |
1263 | 1263 |
|
1264 | 1264 | /* ---------- |
1265 | 1265 | * The query string built is |
1266 | | - *UPDATE <fktable> SET fkatt1 = $1 [, ...] |
| 1266 | + *UPDATEONLY<fktable> SET fkatt1 = $1 [, ...] |
1267 | 1267 | *WHERE fkatt1 = $n [AND ...] |
1268 | 1268 | * The type id's for the $ parameters are those of the |
1269 | 1269 | * corresponding PK attributes. Thus, SPI_prepare could |
1270 | 1270 | * eventually fail if the parser cannot identify some way |
1271 | 1271 | * how to compare these two types by '='. |
1272 | 1272 | * ---------- |
1273 | 1273 | */ |
1274 | | -sprintf(querystr,"UPDATE \"%s\" SET", |
| 1274 | +sprintf(querystr,"UPDATEONLY\"%s\" SET", |
1275 | 1275 | tgargs[RI_FK_RELNAME_ARGNO]); |
1276 | 1276 | qualstr[0]='\0'; |
1277 | 1277 | querysep=""; |
@@ -1483,14 +1483,14 @@ RI_FKey_restrict_del(PG_FUNCTION_ARGS) |
1483 | 1483 |
|
1484 | 1484 | /* ---------- |
1485 | 1485 | * The query string built is |
1486 | | - *SELECT oid FROM <fktable> WHERE fkatt1 = $1 [AND ...] |
| 1486 | + *SELECT oid FROMONLY<fktable> WHERE fkatt1 = $1 [AND ...] |
1487 | 1487 | * The type id's for the $ parameters are those of the |
1488 | 1488 | * corresponding PK attributes. Thus, SPI_prepare could |
1489 | 1489 | * eventually fail if the parser cannot identify some way |
1490 | 1490 | * how to compare these two types by '='. |
1491 | 1491 | * ---------- |
1492 | 1492 | */ |
1493 | | -sprintf(querystr,"SELECT oid FROM \"%s\"", |
| 1493 | +sprintf(querystr,"SELECT oid FROMONLY\"%s\"", |
1494 | 1494 | tgargs[RI_FK_RELNAME_ARGNO]); |
1495 | 1495 | querysep="WHERE"; |
1496 | 1496 | for (i=0;i<qkey.nkeypairs;i++) |
@@ -1708,14 +1708,14 @@ RI_FKey_restrict_upd(PG_FUNCTION_ARGS) |
1708 | 1708 |
|
1709 | 1709 | /* ---------- |
1710 | 1710 | * The query string built is |
1711 | | - *SELECT oid FROM <fktable> WHERE fkatt1 = $1 [AND ...] |
| 1711 | + *SELECT oid FROMONLY<fktable> WHERE fkatt1 = $1 [AND ...] |
1712 | 1712 | * The type id's for the $ parameters are those of the |
1713 | 1713 | * corresponding PK attributes. Thus, SPI_prepare could |
1714 | 1714 | * eventually fail if the parser cannot identify some way |
1715 | 1715 | * how to compare these two types by '='. |
1716 | 1716 | * ---------- |
1717 | 1717 | */ |
1718 | | -sprintf(querystr,"SELECT oid FROM \"%s\"", |
| 1718 | +sprintf(querystr,"SELECT oid FROMONLY\"%s\"", |
1719 | 1719 | tgargs[RI_FK_RELNAME_ARGNO]); |
1720 | 1720 | querysep="WHERE"; |
1721 | 1721 | for (i=0;i<qkey.nkeypairs;i++) |
@@ -1919,15 +1919,15 @@ RI_FKey_setnull_del(PG_FUNCTION_ARGS) |
1919 | 1919 |
|
1920 | 1920 | /* ---------- |
1921 | 1921 | * The query string built is |
1922 | | - *UPDATE <fktable> SET fkatt1 = NULL [, ...] |
| 1922 | + *UPDATEONLY<fktable> SET fkatt1 = NULL [, ...] |
1923 | 1923 | *WHERE fkatt1 = $1 [AND ...] |
1924 | 1924 | * The type id's for the $ parameters are those of the |
1925 | 1925 | * corresponding PK attributes. Thus, SPI_prepare could |
1926 | 1926 | * eventually fail if the parser cannot identify some way |
1927 | 1927 | * how to compare these two types by '='. |
1928 | 1928 | * ---------- |
1929 | 1929 | */ |
1930 | | -sprintf(querystr,"UPDATE \"%s\" SET", |
| 1930 | +sprintf(querystr,"UPDATEONLY\"%s\" SET", |
1931 | 1931 | tgargs[RI_FK_RELNAME_ARGNO]); |
1932 | 1932 | qualstr[0]='\0'; |
1933 | 1933 | querysep=""; |
@@ -2157,15 +2157,15 @@ RI_FKey_setnull_upd(PG_FUNCTION_ARGS) |
2157 | 2157 |
|
2158 | 2158 | /* ---------- |
2159 | 2159 | * The query string built is |
2160 | | - *UPDATE <fktable> SET fkatt1 = NULL [, ...] |
| 2160 | + *UPDATEONLY<fktable> SET fkatt1 = NULL [, ...] |
2161 | 2161 | *WHERE fkatt1 = $1 [AND ...] |
2162 | 2162 | * The type id's for the $ parameters are those of the |
2163 | 2163 | * corresponding PK attributes. Thus, SPI_prepare could |
2164 | 2164 | * eventually fail if the parser cannot identify some way |
2165 | 2165 | * how to compare these two types by '='. |
2166 | 2166 | * ---------- |
2167 | 2167 | */ |
2168 | | -sprintf(querystr,"UPDATE \"%s\" SET", |
| 2168 | +sprintf(querystr,"UPDATEONLY\"%s\" SET", |
2169 | 2169 | tgargs[RI_FK_RELNAME_ARGNO]); |
2170 | 2170 | qualstr[0]='\0'; |
2171 | 2171 | querysep=""; |
@@ -2385,15 +2385,15 @@ RI_FKey_setdefault_del(PG_FUNCTION_ARGS) |
2385 | 2385 |
|
2386 | 2386 | /* ---------- |
2387 | 2387 | * The query string built is |
2388 | | - *UPDATE <fktable> SET fkatt1 = NULL [, ...] |
| 2388 | + *UPDATEONLY<fktable> SET fkatt1 = NULL [, ...] |
2389 | 2389 | *WHERE fkatt1 = $1 [AND ...] |
2390 | 2390 | * The type id's for the $ parameters are those of the |
2391 | 2391 | * corresponding PK attributes. Thus, SPI_prepare could |
2392 | 2392 | * eventually fail if the parser cannot identify some way |
2393 | 2393 | * how to compare these two types by '='. |
2394 | 2394 | * ---------- |
2395 | 2395 | */ |
2396 | | -sprintf(querystr,"UPDATE \"%s\" SET", |
| 2396 | +sprintf(querystr,"UPDATEONLY\"%s\" SET", |
2397 | 2397 | tgargs[RI_FK_RELNAME_ARGNO]); |
2398 | 2398 | qualstr[0]='\0'; |
2399 | 2399 | querysep=""; |
@@ -2651,15 +2651,15 @@ RI_FKey_setdefault_upd(PG_FUNCTION_ARGS) |
2651 | 2651 |
|
2652 | 2652 | /* ---------- |
2653 | 2653 | * The query string built is |
2654 | | - *UPDATE <fktable> SET fkatt1 = NULL [, ...] |
| 2654 | + *UPDATEONLY<fktable> SET fkatt1 = NULL [, ...] |
2655 | 2655 | *WHERE fkatt1 = $1 [AND ...] |
2656 | 2656 | * The type id's for the $ parameters are those of the |
2657 | 2657 | * corresponding PK attributes. Thus, SPI_prepare could |
2658 | 2658 | * eventually fail if the parser cannot identify some way |
2659 | 2659 | * how to compare these two types by '='. |
2660 | 2660 | * ---------- |
2661 | 2661 | */ |
2662 | | -sprintf(querystr,"UPDATE \"%s\" SET", |
| 2662 | +sprintf(querystr,"UPDATEONLY\"%s\" SET", |
2663 | 2663 | tgargs[RI_FK_RELNAME_ARGNO]); |
2664 | 2664 | qualstr[0]='\0'; |
2665 | 2665 | querysep=""; |
|