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

Commit290713e

Browse files
committed
Fix another test for RELKIND_RELATION that should allow foreign tables now.
I thought I'd gone through all of these before, but a fresh review foundthis one too. (Perhaps it would be better to just delete this test andlet the failure occur later, but for the moment I'll preserve the logic.)The case that this was rejecting is likeCREATE FOREIGN TABLE ft (f1 int ...) ...;CREATE TABLE c1 (UNIQUE(f1)) INHERITS(ft);
1 parentad9f08f commit290713e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

‎src/backend/parser/parse_utilcmd.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1799,10 +1799,12 @@ transformIndexConstraint(Constraint *constraint, CreateStmtContext *cxt)
17991799

18001800
Assert(IsA(inh,RangeVar));
18011801
rel=heap_openrv(inh,AccessShareLock);
1802-
if (rel->rd_rel->relkind!=RELKIND_RELATION)
1802+
/* check user requested inheritance from valid relkind */
1803+
if (rel->rd_rel->relkind!=RELKIND_RELATION&&
1804+
rel->rd_rel->relkind!=RELKIND_FOREIGN_TABLE)
18031805
ereport(ERROR,
18041806
(errcode(ERRCODE_WRONG_OBJECT_TYPE),
1805-
errmsg("inherited relation \"%s\" is not a table",
1807+
errmsg("inherited relation \"%s\" is not a table or foreign table",
18061808
inh->relname)));
18071809
for (count=0;count<rel->rd_att->natts;count++)
18081810
{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp