mirror of
https://github.com/postgres/postgres.git
synced 2025-06-17 17:02:08 +03:00
ALTER <thing> [IF EXISTS] ... allows silent DDL if required,
e.g. ALTER FOREIGN TABLE IF EXISTS foo RENAME TO bar Pavel Stehule
This commit is contained in:
@ -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);
|
||||
|
Reference in New Issue
Block a user