Thread: pgsql: Allow CREATE TABLE IF EXIST so succeed if the schema is nonexist

pgsql: Allow CREATE TABLE IF EXIST so succeed if the schema is nonexist

From
Bruce Momjian
Date:
Allow CREATE TABLE IF EXIST so succeed if the schema is nonexistent

Previously, CREATE TABLE IF EXIST threw an error if the schema was
nonexistent.  This was done by passing 'missing_ok' to the function that
looks up the schema oid.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/7e2322dff30c04d90c0602d2b5ae24b4881db88b

Modified Files
--------------
src/backend/catalog/aclchk.c       |    2 +-
src/backend/catalog/namespace.c    |   86 +++++++++++++++++++++++------------
src/backend/commands/indexcmds.c   |    2 +-
src/backend/commands/opclasscmds.c |    4 +-
src/backend/commands/trigger.c     |    3 +-
src/backend/parser/parse_oper.c    |    2 +-
src/backend/parser/parse_type.c    |    2 +-
src/backend/utils/adt/xml.c        |    6 +-
src/include/catalog/namespace.h    |    2 +-
9 files changed, 68 insertions(+), 41 deletions(-)


Re: pgsql: Allow CREATE TABLE IF EXIST so succeed if the schema is nonexist

From
Jaime Casanova
Date:
On Sat, Jan 26, 2013 at 1:24 PM, Bruce Momjian <bruce@momjian.us> wrote:
> Allow CREATE TABLE IF EXIST so succeed if the schema is nonexistent
>

you meant DROP TABLE IF EXISTS, right?

--
Jaime Casanova         www.2ndQuadrant.com
Professional PostgreSQL: Soporte 24x7 y capacitación
Phone: +593 4 5107566         Cell: +593 987171157


Re: pgsql: Allow CREATE TABLE IF EXIST so succeed if the schema is nonexist

From
Bruce Momjian
Date:
On Sat, Jan 26, 2013 at 01:30:53PM -0500, Jaime Casanova wrote:
> On Sat, Jan 26, 2013 at 1:24 PM, Bruce Momjian <bruce@momjian.us> wrote:
> > Allow CREATE TABLE IF EXIST so succeed if the schema is nonexistent
> >
>
> you meant DROP TABLE IF EXISTS, right?

Oh, yes.  DROP TABLE.  I needed to update some C comments anyway so I
added the correct in that commit message.  Thanks for the heads-up.

--
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + It's impossible for everything to be true. +