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

Commite506ca4

Browse files
committed
Tables without oids wouldn't be able to be
used inside fk constraints, since some of the checksin the trigger did a SELECT oid. Since the oid wasn'tactually used, I changed this to SELECT 1. My testcase with non-oid tables now works and fk regressionappears to run fine on my machine.Stephan Szabo
1 parent9371325 commite506ca4

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

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

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
* Portions Copyright (c) 2000-2001, PostgreSQL Global Development Group
1919
* Copyright 1999 Jan Wieck
2020
*
21-
* $Header: /cvsroot/pgsql/src/backend/utils/adt/ri_triggers.c,v 1.30 2001/11/1200:46:36 tgl Exp $
21+
* $Header: /cvsroot/pgsql/src/backend/utils/adt/ri_triggers.c,v 1.31 2001/11/1206:09:09 momjian Exp $
2222
*
2323
* ----------
2424
*/
@@ -232,10 +232,10 @@ RI_FKey_check(PG_FUNCTION_ARGS)
232232

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

@@ -376,14 +376,14 @@ RI_FKey_check(PG_FUNCTION_ARGS)
376376

377377
/* ----------
378378
* The query string built is
379-
*SELECToid FROM ONLY <pktable> WHERE pkatt1 = $1 [AND ...]
379+
*SELECT1 FROM ONLY <pktable> WHERE pkatt1 = $1 [AND ...]
380380
* The type id's for the $ parameters are those of the
381381
* corresponding FK attributes. Thus, SPI_prepare could
382382
* eventually fail if the parser cannot identify some way
383383
* how to compare these two types by '='.
384384
* ----------
385385
*/
386-
sprintf(querystr,"SELECToid FROM ONLY \"%s\"",
386+
sprintf(querystr,"SELECT1 FROM ONLY \"%s\"",
387387
tgargs[RI_PK_RELNAME_ARGNO]);
388388
querysep="WHERE";
389389
for (i=0;i<qkey.nkeypairs;i++)
@@ -609,14 +609,14 @@ RI_FKey_noaction_del(PG_FUNCTION_ARGS)
609609

610610
/* ----------
611611
* The query string built is
612-
*SELECToid FROM ONLY <fktable> WHERE fkatt1 = $1 [AND ...]
612+
*SELECT1 FROM ONLY <fktable> WHERE fkatt1 = $1 [AND ...]
613613
* The type id's for the $ parameters are those of the
614614
* corresponding PK attributes. Thus, SPI_prepare could
615615
* eventually fail if the parser cannot identify some way
616616
* how to compare these two types by '='.
617617
* ----------
618618
*/
619-
sprintf(querystr,"SELECToid FROM ONLY \"%s\"",
619+
sprintf(querystr,"SELECT1 FROM ONLY \"%s\"",
620620
tgargs[RI_FK_RELNAME_ARGNO]);
621621
querysep="WHERE";
622622
for (i=0;i<qkey.nkeypairs;i++)
@@ -823,14 +823,14 @@ RI_FKey_noaction_upd(PG_FUNCTION_ARGS)
823823

824824
/* ----------
825825
* The query string built is
826-
*SELECToid FROM ONLY <fktable> WHERE fkatt1 = $1 [AND ...]
826+
*SELECT1 FROM ONLY <fktable> WHERE fkatt1 = $1 [AND ...]
827827
* The type id's for the $ parameters are those of the
828828
* corresponding PK attributes. Thus, SPI_prepare could
829829
* eventually fail if the parser cannot identify some way
830830
* how to compare these two types by '='.
831831
* ----------
832832
*/
833-
sprintf(querystr,"SELECToid FROM ONLY \"%s\"",
833+
sprintf(querystr,"SELECT1 FROM ONLY \"%s\"",
834834
tgargs[RI_FK_RELNAME_ARGNO]);
835835
querysep="WHERE";
836836
for (i=0;i<qkey.nkeypairs;i++)
@@ -1450,14 +1450,14 @@ RI_FKey_restrict_del(PG_FUNCTION_ARGS)
14501450

14511451
/* ----------
14521452
* The query string built is
1453-
*SELECToid FROM ONLY <fktable> WHERE fkatt1 = $1 [AND ...]
1453+
*SELECT1 FROM ONLY <fktable> WHERE fkatt1 = $1 [AND ...]
14541454
* The type id's for the $ parameters are those of the
14551455
* corresponding PK attributes. Thus, SPI_prepare could
14561456
* eventually fail if the parser cannot identify some way
14571457
* how to compare these two types by '='.
14581458
* ----------
14591459
*/
1460-
sprintf(querystr,"SELECToid FROM ONLY \"%s\"",
1460+
sprintf(querystr,"SELECT1 FROM ONLY \"%s\"",
14611461
tgargs[RI_FK_RELNAME_ARGNO]);
14621462
querysep="WHERE";
14631463
for (i=0;i<qkey.nkeypairs;i++)
@@ -1670,14 +1670,14 @@ RI_FKey_restrict_upd(PG_FUNCTION_ARGS)
16701670

16711671
/* ----------
16721672
* The query string built is
1673-
*SELECToid FROM ONLY <fktable> WHERE fkatt1 = $1 [AND ...]
1673+
*SELECT1 FROM ONLY <fktable> WHERE fkatt1 = $1 [AND ...]
16741674
* The type id's for the $ parameters are those of the
16751675
* corresponding PK attributes. Thus, SPI_prepare could
16761676
* eventually fail if the parser cannot identify some way
16771677
* how to compare these two types by '='.
16781678
* ----------
16791679
*/
1680-
sprintf(querystr,"SELECToid FROM ONLY \"%s\"",
1680+
sprintf(querystr,"SELECT1 FROM ONLY \"%s\"",
16811681
tgargs[RI_FK_RELNAME_ARGNO]);
16821682
querysep="WHERE";
16831683
for (i=0;i<qkey.nkeypairs;i++)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp