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

Commit02d88ef

Browse files
committed
In plpgsql, allow foreign tables to define row types.
This seems to have been just an oversight in previous foreign-table work.A quick grep didn't turn up any other places where RELKIND_FOREIGN_TABLEwas obviously omitted.One change noted by Alexander Soudakov, the other by me.Back-patch to 9.1.
1 parent95d2af1 commit02d88ef

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

‎src/pl/plpgsql/src/pl_comp.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1721,12 +1721,13 @@ plpgsql_parse_cwordtype(List *idents)
17211721
classStruct= (Form_pg_class)GETSTRUCT(classtup);
17221722

17231723
/*
1724-
* It must be a relation, sequence, view,or type
1724+
* It must be a relation, sequence, view,composite type, or foreign table
17251725
*/
17261726
if (classStruct->relkind!=RELKIND_RELATION&&
17271727
classStruct->relkind!=RELKIND_SEQUENCE&&
17281728
classStruct->relkind!=RELKIND_VIEW&&
1729-
classStruct->relkind!=RELKIND_COMPOSITE_TYPE)
1729+
classStruct->relkind!=RELKIND_COMPOSITE_TYPE&&
1730+
classStruct->relkind!=RELKIND_FOREIGN_TABLE)
17301731
gotodone;
17311732

17321733
/*
@@ -1942,11 +1943,12 @@ build_row_from_class(Oid classOid)
19421943
classStruct=RelationGetForm(rel);
19431944
relname=RelationGetRelationName(rel);
19441945

1945-
/* accept relation, sequence, view,orcomposite type entries */
1946+
/* accept relation, sequence, view, composite type, or foreign table */
19461947
if (classStruct->relkind!=RELKIND_RELATION&&
19471948
classStruct->relkind!=RELKIND_SEQUENCE&&
19481949
classStruct->relkind!=RELKIND_VIEW&&
1949-
classStruct->relkind!=RELKIND_COMPOSITE_TYPE)
1950+
classStruct->relkind!=RELKIND_COMPOSITE_TYPE&&
1951+
classStruct->relkind!=RELKIND_FOREIGN_TABLE)
19501952
ereport(ERROR,
19511953
(errcode(ERRCODE_WRONG_OBJECT_TYPE),
19521954
errmsg("relation \"%s\" is not a table",relname)));

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp