forked from huawei/openGauss-server
submit code to openGauss-server
Offering: openGaussDev More detail: fix owner for fdw Signed-off-by:chenbobo <chenbobo3@huawei.com> Match-id-0cdd43e2bf4f91363b42dec95cd648e902b88bd5
This commit is contained in:
parent
a4da772704
commit
d28a571efd
|
|
@ -1151,7 +1151,6 @@ static void deparseRelation(StringInfo buf, Relation rel)
|
||||||
const char *nspname = NULL;
|
const char *nspname = NULL;
|
||||||
const char *relname = NULL;
|
const char *relname = NULL;
|
||||||
ListCell *lc;
|
ListCell *lc;
|
||||||
char parttype = PARTTYPE_NON_PARTITIONED_RELATION;
|
|
||||||
|
|
||||||
/* obtain additional catalog information. */
|
/* obtain additional catalog information. */
|
||||||
ForeignTable* table = GetForeignTable(RelationGetRelid(rel));
|
ForeignTable* table = GetForeignTable(RelationGetRelid(rel));
|
||||||
|
|
@ -1180,8 +1179,11 @@ static void deparseRelation(StringInfo buf, Relation rel)
|
||||||
relname = RelationGetRelationName(rel);
|
relname = RelationGetRelationName(rel);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* foreign table could not be built from a partitioned table */
|
/* In current version, there are some unpredictable operations (delete/update, etc.) of foreign table built on
|
||||||
UserMapping* user = GetUserMapping(rel->rd_rel->relowner, table->serverid);
|
* partitioned table. We forbid all operations in this condition by default. */
|
||||||
|
if (!ENABLE_SQL_BETA_FEATURE(PARTITION_FDW_ON)) {
|
||||||
|
char parttype = PARTTYPE_NON_PARTITIONED_RELATION;
|
||||||
|
UserMapping* user = GetUserMapping(GetUserId(), table->serverid);
|
||||||
ForeignServer *server = GetForeignServer(table->serverid);
|
ForeignServer *server = GetForeignServer(table->serverid);
|
||||||
PGconn* conn = GetConnection(server, user, false);
|
PGconn* conn = GetConnection(server, user, false);
|
||||||
|
|
||||||
|
|
@ -1202,10 +1204,10 @@ static void deparseRelation(StringInfo buf, Relation rel)
|
||||||
PQclear(res);
|
PQclear(res);
|
||||||
destroyPQExpBuffer(query);
|
destroyPQExpBuffer(query);
|
||||||
|
|
||||||
if (!ENABLE_SQL_BETA_FEATURE(PARTITION_FDW_ON) &&
|
if ((parttype == PARTTYPE_PARTITIONED_RELATION || parttype == PARTTYPE_SUBPARTITIONED_RELATION)) {
|
||||||
(parttype == PARTTYPE_PARTITIONED_RELATION || parttype == PARTTYPE_SUBPARTITIONED_RELATION)) {
|
|
||||||
ereport(ERROR, (errmsg("could not operate foreign table on partitioned table")));
|
ereport(ERROR, (errmsg("could not operate foreign table on partitioned table")));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
appendStringInfo(buf, "%s.%s", quote_identifier(nspname), quote_identifier(relname));
|
appendStringInfo(buf, "%s.%s", quote_identifier(nspname), quote_identifier(relname));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue