aboutsummaryrefslogtreecommitdiff
path: root/src/backend/parser/parse_utilcmd.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/parser/parse_utilcmd.c')
-rw-r--r--src/backend/parser/parse_utilcmd.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/backend/parser/parse_utilcmd.c b/src/backend/parser/parse_utilcmd.c
index 99157c53493..f1a108a9828 100644
--- a/src/backend/parser/parse_utilcmd.c
+++ b/src/backend/parser/parse_utilcmd.c
@@ -2283,7 +2283,15 @@ transformAlterTableStmt(AlterTableStmt *stmt, const char *queryString)
* new commands we add after this must not upgrade the lock level
* requested here.
*/
- rel = relation_openrv(stmt->relation, lockmode);
+ rel = relation_openrv_extended(stmt->relation, lockmode, stmt->missing_ok);
+ if (rel == NULL)
+ {
+ /* this message is consistent with relation_openrv */
+ ereport(NOTICE,
+ (errmsg("relation \"%s\" does not exist, skipping",
+ stmt->relation->relname)));
+ return NIL;
+ }
/* Set up pstate and CreateStmtContext */
pstate = make_parsestate(NULL);