*** pgsql/src/backend/utils/adt/ri_triggers.c.orig Thu Nov 8 00:04:25 2001 --- pgsql/src/backend/utils/adt/ri_triggers.c Thu Nov 8 00:10:27 2001 *************** *** 242,251 **** /* --------- * The query string built is ! * SELECT oid FROM ONLY * ---------- */ ! sprintf(querystr, "SELECT oid FROM ONLY \"%s\" FOR UPDATE OF \"%s\"", tgargs[RI_PK_RELNAME_ARGNO], tgargs[RI_PK_RELNAME_ARGNO]); --- 242,251 ---- /* --------- * The query string built is ! * SELECT 1 FROM ONLY * ---------- */ ! sprintf(querystr, "SELECT 1 FROM ONLY \"%s\" FOR UPDATE OF \"%s\"", tgargs[RI_PK_RELNAME_ARGNO], tgargs[RI_PK_RELNAME_ARGNO]); *************** *** 386,399 **** /* ---------- * The query string built is ! * SELECT oid FROM ONLY WHERE pkatt1 = $1 [AND ...] * The type id's for the $ parameters are those of the * corresponding FK attributes. Thus, SPI_prepare could * eventually fail if the parser cannot identify some way * how to compare these two types by '='. * ---------- */ ! sprintf(querystr, "SELECT oid FROM ONLY \"%s\"", tgargs[RI_PK_RELNAME_ARGNO]); querysep = "WHERE"; for (i = 0; i < qkey.nkeypairs; i++) --- 386,399 ---- /* ---------- * The query string built is ! * SELECT 1 FROM ONLY WHERE pkatt1 = $1 [AND ...] * The type id's for the $ parameters are those of the * corresponding FK attributes. Thus, SPI_prepare could * eventually fail if the parser cannot identify some way * how to compare these two types by '='. * ---------- */ ! sprintf(querystr, "SELECT 1 FROM ONLY \"%s\"", tgargs[RI_PK_RELNAME_ARGNO]); querysep = "WHERE"; for (i = 0; i < qkey.nkeypairs; i++) *************** *** 620,633 **** /* ---------- * The query string built is ! * SELECT oid FROM ONLY WHERE fkatt1 = $1 [AND ...] * The type id's for the $ parameters are those of the * corresponding PK attributes. Thus, SPI_prepare could * eventually fail if the parser cannot identify some way * how to compare these two types by '='. * ---------- */ ! sprintf(querystr, "SELECT oid FROM ONLY \"%s\"", tgargs[RI_FK_RELNAME_ARGNO]); querysep = "WHERE"; for (i = 0; i < qkey.nkeypairs; i++) --- 620,633 ---- /* ---------- * The query string built is ! * SELECT 1 FROM ONLY WHERE fkatt1 = $1 [AND ...] * The type id's for the $ parameters are those of the * corresponding PK attributes. Thus, SPI_prepare could * eventually fail if the parser cannot identify some way * how to compare these two types by '='. * ---------- */ ! sprintf(querystr, "SELECT 1 FROM ONLY \"%s\"", tgargs[RI_FK_RELNAME_ARGNO]); querysep = "WHERE"; for (i = 0; i < qkey.nkeypairs; i++) *************** *** 834,847 **** /* ---------- * The query string built is ! * SELECT oid FROM ONLY WHERE fkatt1 = $1 [AND ...] * The type id's for the $ parameters are those of the * corresponding PK attributes. Thus, SPI_prepare could * eventually fail if the parser cannot identify some way * how to compare these two types by '='. * ---------- */ ! sprintf(querystr, "SELECT oid FROM ONLY \"%s\"", tgargs[RI_FK_RELNAME_ARGNO]); querysep = "WHERE"; for (i = 0; i < qkey.nkeypairs; i++) --- 834,847 ---- /* ---------- * The query string built is ! * SELECT 1 FROM ONLY WHERE fkatt1 = $1 [AND ...] * The type id's for the $ parameters are those of the * corresponding PK attributes. Thus, SPI_prepare could * eventually fail if the parser cannot identify some way * how to compare these two types by '='. * ---------- */ ! sprintf(querystr, "SELECT 1 FROM ONLY \"%s\"", tgargs[RI_FK_RELNAME_ARGNO]); querysep = "WHERE"; for (i = 0; i < qkey.nkeypairs; i++) *************** *** 1461,1474 **** /* ---------- * The query string built is ! * SELECT oid FROM ONLY WHERE fkatt1 = $1 [AND ...] * The type id's for the $ parameters are those of the * corresponding PK attributes. Thus, SPI_prepare could * eventually fail if the parser cannot identify some way * how to compare these two types by '='. * ---------- */ ! sprintf(querystr, "SELECT oid FROM ONLY \"%s\"", tgargs[RI_FK_RELNAME_ARGNO]); querysep = "WHERE"; for (i = 0; i < qkey.nkeypairs; i++) --- 1461,1474 ---- /* ---------- * The query string built is ! * SELECT 1 FROM ONLY WHERE fkatt1 = $1 [AND ...] * The type id's for the $ parameters are those of the * corresponding PK attributes. Thus, SPI_prepare could * eventually fail if the parser cannot identify some way * how to compare these two types by '='. * ---------- */ ! sprintf(querystr, "SELECT 1 FROM ONLY \"%s\"", tgargs[RI_FK_RELNAME_ARGNO]); querysep = "WHERE"; for (i = 0; i < qkey.nkeypairs; i++) *************** *** 1681,1694 **** /* ---------- * The query string built is ! * SELECT oid FROM ONLY WHERE fkatt1 = $1 [AND ...] * The type id's for the $ parameters are those of the * corresponding PK attributes. Thus, SPI_prepare could * eventually fail if the parser cannot identify some way * how to compare these two types by '='. * ---------- */ ! sprintf(querystr, "SELECT oid FROM ONLY \"%s\"", tgargs[RI_FK_RELNAME_ARGNO]); querysep = "WHERE"; for (i = 0; i < qkey.nkeypairs; i++) --- 1681,1694 ---- /* ---------- * The query string built is ! * SELECT 1 FROM ONLY WHERE fkatt1 = $1 [AND ...] * The type id's for the $ parameters are those of the * corresponding PK attributes. Thus, SPI_prepare could * eventually fail if the parser cannot identify some way * how to compare these two types by '='. * ---------- */ ! sprintf(querystr, "SELECT 1 FROM ONLY \"%s\"", tgargs[RI_FK_RELNAME_ARGNO]); querysep = "WHERE"; for (i = 0; i < qkey.nkeypairs; i++)