mirror of
https://github.com/postgres/postgres.git
synced 2025-07-02 09:02:37 +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:
@ -425,7 +425,15 @@ AlterSequence(AlterSeqStmt *stmt)
|
||||
List *owned_by;
|
||||
|
||||
/* Open and lock sequence. */
|
||||
relid = RangeVarGetRelid(stmt->sequence, AccessShareLock, false);
|
||||
relid = RangeVarGetRelid(stmt->sequence, AccessShareLock, stmt->missing_ok);
|
||||
if (relid == InvalidOid)
|
||||
{
|
||||
ereport(NOTICE,
|
||||
(errmsg("relation \"%s\" does not exist, skipping",
|
||||
stmt->sequence->relname)));
|
||||
return;
|
||||
}
|
||||
|
||||
init_sequence(relid, &elm, &seqrel);
|
||||
|
||||
/* allow ALTER to sequence owner only */
|
||||
|
Reference in New Issue
Block a user