Skip to content

Commit 7d7c997

Browse files
committed
Restore erroneously removed ONLY from PK check
This is a blind fix, since I don't have SE-Linux to verify it. Per unwanted change in rhinoceros, running sepgsql tests. Noted by Tom Lane. Discussion: https://postgr.es/m/32347.1522865050@sss.pgh.pa.us
1 parent 446f7f5 commit 7d7c997

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/backend/utils/adt/ri_triggers.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1915,7 +1915,7 @@ RI_Initial_Check(Trigger *trigger, Relation fk_rel, Relation pk_rel)
19151915
/*----------
19161916
* The query string built is:
19171917
* SELECT fk.keycols FROM [ONLY] relname fk
1918-
* LEFT OUTER JOIN pkrelname pk
1918+
* LEFT OUTER JOIN ONLY pkrelname pk
19191919
* ON (pk.pkkeycol1=fk.keycol1 [AND ...])
19201920
* WHERE pk.pkkeycol1 IS NULL AND
19211921
* For MATCH SIMPLE:
@@ -1943,7 +1943,7 @@ RI_Initial_Check(Trigger *trigger, Relation fk_rel, Relation pk_rel)
19431943
fk_only = fk_rel->rd_rel->relkind == RELKIND_PARTITIONED_TABLE ?
19441944
"" : "ONLY ";
19451945
appendStringInfo(&querybuf,
1946-
" FROM %s%s fk LEFT OUTER JOIN %s pk ON",
1946+
" FROM %s%s fk LEFT OUTER JOIN ONLY %s pk ON",
19471947
fk_only, fkrelname, pkrelname);
19481948

19491949
strcpy(pkattname, "pk.");

0 commit comments

Comments
 (0)