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

Commit37fb017

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 parent07d5205 commit37fb017

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
/*
@@ -1947,11 +1948,12 @@ build_row_from_class(Oid classOid)
19471948
classStruct=RelationGetForm(rel);
19481949
relname=RelationGetRelationName(rel);
19491950

1950-
/* accept relation, sequence, view,orcomposite type entries */
1951+
/* accept relation, sequence, view, composite type, or foreign table */
19511952
if (classStruct->relkind!=RELKIND_RELATION&&
19521953
classStruct->relkind!=RELKIND_SEQUENCE&&
19531954
classStruct->relkind!=RELKIND_VIEW&&
1954-
classStruct->relkind!=RELKIND_COMPOSITE_TYPE)
1955+
classStruct->relkind!=RELKIND_COMPOSITE_TYPE&&
1956+
classStruct->relkind!=RELKIND_FOREIGN_TABLE)
19551957
ereport(ERROR,
19561958
(errcode(ERRCODE_WRONG_OBJECT_TYPE),
19571959
errmsg("relation \"%s\" is not a table",relname)));

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp