Skip to content
Snippets Groups Projects
Select Git revision
  • benchmark-tools
  • postgres-lambda
  • master default
  • REL9_4_25
  • REL9_5_20
  • REL9_6_16
  • REL_10_11
  • REL_11_6
  • REL_12_1
  • REL_12_0
  • REL_12_RC1
  • REL_12_BETA4
  • REL9_4_24
  • REL9_5_19
  • REL9_6_15
  • REL_10_10
  • REL_11_5
  • REL_12_BETA3
  • REL9_4_23
  • REL9_5_18
  • REL9_6_14
  • REL_10_9
  • REL_11_4
23 results

parse_utilcmd.c

  • Robert Haas's avatar
    68ef051f
    Refactor broken CREATE TABLE IF NOT EXISTS support. · 68ef051f
    Robert Haas authored
    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.
    68ef051f
    History
    Refactor broken CREATE TABLE IF NOT EXISTS support.
    Robert Haas authored
    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.