diff options
author | Robert Haas | 2011-04-25 20:55:11 +0000 |
---|---|---|
committer | Robert Haas | 2011-04-25 20:55:11 +0000 |
commit | 68ef051f5cf16f82a5368067a40ffba3c340b0d3 (patch) | |
tree | 6b8158651e981c35d3653f59114ef33ec9946a2f /src/backend/bootstrap | |
parent | be90032e0d1cf473bdd99aee94218218f59f29f1 (diff) |
Refactor broken CREATE TABLE IF NOT EXISTS support.
Per bug #5988, reported by Marko Tiikkaja, and further analyzed by Tom
Lane, the previous coding was broken in several respects: even if the
target table already existed, a subsequent CREATE TABLE IF NOT EXISTS
might try to add additional constraints or sequences-for-serial
specified in the new CREATE TABLE statement.
In passing, this also fixes a minor information leak: it's no longer
possible to figure out whether a schema to which you don't have CREATE
access contains a sequence named like "x_y_seq" by attempting to create a
table in that schema called "x" with a serial column called "y".
Some more refactoring of this code in the future might be warranted,
but that will need to wait for a later major release.
Diffstat (limited to 'src/backend/bootstrap')
-rw-r--r-- | src/backend/bootstrap/bootparse.y | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/backend/bootstrap/bootparse.y b/src/backend/bootstrap/bootparse.y index 75a137bbd77..a9d24286989 100644 --- a/src/backend/bootstrap/bootparse.y +++ b/src/backend/bootstrap/bootparse.y @@ -247,8 +247,7 @@ Boot_CreateStmt: ONCOMMIT_NOOP, (Datum) 0, false, - true, - false); + true); elog(DEBUG4, "relation created with oid %u", id); } do_end(); |