Skip to content

Commit

Permalink
RelationIsUsedAsCatalogTable() parse analysis check
Browse files Browse the repository at this point in the history
Andres should look over this.
  • Loading branch information
petergeoghegan committed Apr 25, 2015
1 parent 851aa12 commit 32d1c4d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/backend/parser/parse_clause.c
Original file line number Diff line number Diff line change
Expand Up @@ -2360,6 +2360,15 @@ transformConflictClause(ParseState *pstate, ConflictClause *confClause,
parser_errposition(pstate,
exprLocation((Node *) confClause))));

/* Same applies to table used by logical decoding as catalog table */
if (RelationIsUsedAsCatalogTable(pstate->p_target_relation))
ereport(ERROR,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
errmsg("ON CONFLICT not supported on table \"%s\" used as a catalog table",
RelationGetRelationName(pstate->p_target_relation)),
parser_errposition(pstate,
exprLocation((Node *) confClause))));

/* ON CONFLICT IGNORE does not require an inference clause */
if (infer)
{
Expand Down

0 comments on commit 32d1c4d

Please sign in to comment.