From eea71b3d3d8a15375f08607c282cba61dc9a209f Mon Sep 17 00:00:00 2001 From: Francisco Guerrero Date: Sun, 18 Nov 2018 20:40:55 -0800 Subject: [PATCH] Remove restriction to INSERT/UPDATE/DELETE foreign relations (#6202) - While spiking on implementing PXF using FDW, we noticed that error messages for file_fdw were different from upstream error messages when updating a file_fdw. GPDB introduced a check in `setTargetTable` for foreign relations that might have not been cleaned up during merge. This PR removes the check in `setTargetTable` and fixes the expected output in file_fdw. Running make installcheck on file_fdw, now succeeds, as we are matching the upstream error message "updates aren't supported". Authored-by: Francisco Guerrero --- src/backend/parser/parse_clause.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/backend/parser/parse_clause.c b/src/backend/parser/parse_clause.c index 63ec306879..a77d8c8312 100644 --- a/src/backend/parser/parse_clause.c +++ b/src/backend/parser/parse_clause.c @@ -364,14 +364,6 @@ setTargetTable(ParseState *pstate, RangeVar *relation, errmsg("permission denied: \"%s\" is a system catalog", RelationGetRelationName(pstate->p_target_relation)))); - /* special check for DML on foreign relations */ - if(RelationIsForeign(pstate->p_target_relation)) - ereport(ERROR, - (errcode(ERRCODE_WRONG_OBJECT_TYPE), - errmsg("foreign tables are read only. cannot change \"%s\"", - RelationGetRelationName(pstate->p_target_relation)))); - - /* special check for DML on external relations */ if(RelationIsExternal(pstate->p_target_relation)) { -- GitLab