Re: CREATE SCHEMA IF NOT EXISTS

From: "Dickson S(dot) Guedes" <listas(at)guedesoft(dot)net>
To: fabriziomello(at)gmail(dot)com
Cc: Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>, david(at)justatheory(dot)com
Subject: Re: CREATE SCHEMA IF NOT EXISTS
Date: 2012-08-28 02:01:19
Message-ID: CAHHcreqw-r+=xTh2+T6XpxiO-SAvZgq7aWSQJ99BPkJt6Vx59Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello,

I reviewed this v5 of patch:

- https://commitfest.postgresql.org/action/patch_view?id=907

The patch is small and implements a new syntax to CREATE SCHEMA
that allow the creation of a schema be skipped when IF NOT EXISTS is
used.

It was applied to 483c2c1071c45e275782d33d646c3018f02f9f94 with
two hunks offset, was compiled without errors or new warnings and
pass all tests, even the tests that covers the expected results for it
self.

The docs was updated with the information about the expected behavior.

I tested against ambiguity, i. e. creating a schema with name 'if' and got the
expected results when try to create it if not exists.

Two questions:

- Should this patch implements others INEs like ADD COLUMN IF NOT EXISTS?
- Should pg_dump or pg_restore support some kind of flag to use a
CREATE SCHEMA IF NOT EXISTS ... instead CREATE SCHEMA ...?

Regards,
--
Dickson S. Guedes
mail/xmpp: guedes(at)guedesoft(dot)net -
skype/twitter: guediz ~ github.com/guedes
http://guedesoft.net ~ http://www.postgresql.org.br

Attachment Content-Type Size
create_schema_if_not_exists_v5.patch application/octet-stream 7.0 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2012-08-28 02:17:43 Re: FATAL: bogus data in lock file "postmaster.pid": ""
Previous Message Tom Lane 2012-08-28 01:59:10 Re: FATAL: bogus data in lock file "postmaster.pid": ""