diff options
| author | Fujii Masao | 2014-11-06 09:48:33 +0000 |
|---|---|---|
| committer | Fujii Masao | 2014-11-06 09:48:33 +0000 |
| commit | 08309aaf74ee879699165ec8a2d53e56f2d2e947 (patch) | |
| tree | 81f6326b3d2f6b47d6d4a2a50494e82709dcf534 /src/backend/commands | |
| parent | 171c377a0abe12d1418540dc154feccd9355995e (diff) | |
Implement IF NOT EXIST for CREATE INDEX.
FabrÃzio de Royes Mello, reviewed by Marti Raudsepp, Adam Brightwell and me.
Diffstat (limited to 'src/backend/commands')
| -rw-r--r-- | src/backend/commands/indexcmds.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c index 3c1e90eb0e..02055950b5 100644 --- a/src/backend/commands/indexcmds.c +++ b/src/backend/commands/indexcmds.c @@ -610,7 +610,14 @@ DefineIndex(Oid relationId, stmt->isconstraint, stmt->deferrable, stmt->initdeferred, allowSystemTableMods, skip_build || stmt->concurrent, - stmt->concurrent, !check_rights); + stmt->concurrent, !check_rights, + stmt->if_not_exists); + + if (!OidIsValid(indexRelationId)) + { + heap_close(rel, NoLock); + return indexRelationId; + } /* Add any requested comment */ if (stmt->idxcomment != NULL) |
