diff options
author | Robert Haas <rhaas@postgresql.org> | 2010-07-25 23:21:22 +0000 |
---|---|---|
committer | Robert Haas <rhaas@postgresql.org> | 2010-07-25 23:21:22 +0000 |
commit | a3b012b560f8871e9c24abb24e28cabc6d3c92ea (patch) | |
tree | 26b6d7f182580269737c3d7c11365c933332e21f /src/backend/commands/view.c | |
parent | edff75bef809629c197c27b23f57baa36330d12e (diff) | |
download | postgresql-a3b012b560f8871e9c24abb24e28cabc6d3c92ea.tar.gz postgresql-a3b012b560f8871e9c24abb24e28cabc6d3c92ea.zip |
CREATE TABLE IF NOT EXISTS.
Reviewed by Bernd Helmle.
Diffstat (limited to 'src/backend/commands/view.c')
-rw-r--r-- | src/backend/commands/view.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/backend/commands/view.c b/src/backend/commands/view.c index 900def01480..1acf1b802d7 100644 --- a/src/backend/commands/view.c +++ b/src/backend/commands/view.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/commands/view.c,v 1.120 2010/01/02 16:57:40 momjian Exp $ + * $PostgreSQL: pgsql/src/backend/commands/view.c,v 1.121 2010/07/25 23:21:21 rhaas Exp $ * *------------------------------------------------------------------------- */ @@ -222,6 +222,8 @@ DefineVirtualRelation(const RangeVar *relation, List *tlist, bool replace) } else { + Oid relid; + /* * now set the parameters for keys/inheritance etc. All of these are * uninteresting for views... @@ -233,13 +235,16 @@ DefineVirtualRelation(const RangeVar *relation, List *tlist, bool replace) createStmt->options = list_make1(defWithOids(false)); createStmt->oncommit = ONCOMMIT_NOOP; createStmt->tablespacename = NULL; + createStmt->if_not_exists = false; /* * finally create the relation (this will error out if there's an * existing view, so we don't need more code to complain if "replace" * is false). */ - return DefineRelation(createStmt, RELKIND_VIEW); + relid = DefineRelation(createStmt, RELKIND_VIEW); + Assert(relid != InvalidOid); + return relid; } } |