diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2013-03-10 14:14:53 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2013-03-10 14:16:02 -0400 |
commit | 21734d2fb896e0ecdddd3251caa72a3576e2d415 (patch) | |
tree | aed4ee5509e618c0fd9746c8be17c5bf23a08a3f /src/backend/parser/analyze.c | |
parent | 7f49a67f954db3e92fd96963169fb8302959576e (diff) |
Support writable foreign tables.
This patch adds the core-system infrastructure needed to support updates
on foreign tables, and extends contrib/postgres_fdw to allow updates
against remote Postgres servers. There's still a great deal of room for
improvement in optimization of remote updates, but at least there's basic
functionality there now.
KaiGai Kohei, reviewed by Alexander Korotkov and Laurenz Albe, and rather
heavily revised by Tom Lane.
Diffstat (limited to 'src/backend/parser/analyze.c')
-rw-r--r-- | src/backend/parser/analyze.c | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/src/backend/parser/analyze.c b/src/backend/parser/analyze.c index d34fca54666..2a943f9c6a5 100644 --- a/src/backend/parser/analyze.c +++ b/src/backend/parser/analyze.c @@ -2164,7 +2164,7 @@ transformCreateTableAsStmt(ParseState *pstate, CreateTableAsStmt *stmt) /* - * Check for features that are not supported together with FOR [KEY] UPDATE/SHARE. + * Check for features that are not supported with FOR [KEY] UPDATE/SHARE. * * exported so planner can check again after rewriting, query pullup, etc */ @@ -2239,9 +2239,6 @@ transformLockingClause(ParseState *pstate, Query *qry, LockingClause *lc, switch (rte->rtekind) { case RTE_RELATION: - /* ignore foreign tables */ - if (rte->relkind == RELKIND_FOREIGN_TABLE) - break; applyLockingClause(qry, i, lc->strength, lc->noWait, pushedDown); rte->requiredPerms |= ACL_SELECT_FOR_UPDATE; @@ -2251,7 +2248,7 @@ transformLockingClause(ParseState *pstate, Query *qry, LockingClause *lc, lc->strength, lc->noWait, pushedDown); /* - * FOR [KEY] UPDATE/SHARE of subquery is propagated to all of + * FOR UPDATE/SHARE of subquery is propagated to all of * subquery's rels, too. We could do this later (based on * the marking of the subquery RTE) but it is convenient * to have local knowledge in each query level about which @@ -2291,12 +2288,6 @@ transformLockingClause(ParseState *pstate, Query *qry, LockingClause *lc, switch (rte->rtekind) { case RTE_RELATION: - if (rte->relkind == RELKIND_FOREIGN_TABLE) - ereport(ERROR, - (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("row-level locks cannot be used with foreign table \"%s\"", - rte->eref->aliasname), - parser_errposition(pstate, thisrel->location))); applyLockingClause(qry, i, lc->strength, lc->noWait, pushedDown); |