mirror of
https://github.com/postgres/postgres.git
synced 2025-06-25 01:02:05 +03:00
Implement IF NOT EXIST for CREATE INDEX.
Fabrízio de Royes Mello, reviewed by Marti Raudsepp, Adam Brightwell and me.
This commit is contained in:
@ -6434,6 +6434,32 @@ IndexStmt: CREATE opt_unique INDEX opt_concurrently opt_index_name
|
||||
n->isconstraint = false;
|
||||
n->deferrable = false;
|
||||
n->initdeferred = false;
|
||||
n->if_not_exists = false;
|
||||
$$ = (Node *)n;
|
||||
}
|
||||
| CREATE opt_unique INDEX opt_concurrently IF_P NOT EXISTS index_name
|
||||
ON qualified_name access_method_clause '(' index_params ')'
|
||||
opt_reloptions OptTableSpace where_clause
|
||||
{
|
||||
IndexStmt *n = makeNode(IndexStmt);
|
||||
n->unique = $2;
|
||||
n->concurrent = $4;
|
||||
n->idxname = $8;
|
||||
n->relation = $10;
|
||||
n->accessMethod = $11;
|
||||
n->indexParams = $13;
|
||||
n->options = $15;
|
||||
n->tableSpace = $16;
|
||||
n->whereClause = $17;
|
||||
n->excludeOpNames = NIL;
|
||||
n->idxcomment = NULL;
|
||||
n->indexOid = InvalidOid;
|
||||
n->oldNode = InvalidOid;
|
||||
n->primary = false;
|
||||
n->isconstraint = false;
|
||||
n->deferrable = false;
|
||||
n->initdeferred = false;
|
||||
n->if_not_exists = true;
|
||||
$$ = (Node *)n;
|
||||
}
|
||||
;
|
||||
|
Reference in New Issue
Block a user