Re: CREATE SCHEMA IF NOT EXISTS
От | Michael Paquier |
---|---|
Тема | Re: CREATE SCHEMA IF NOT EXISTS |
Дата | |
Msg-id | CAB7nPqRoK_bsoV1Y3tgWQa2LmuKRnJtmWDXj_vT7xrbN0VzMMg@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: CREATE SCHEMA IF NOT EXISTS ("David E. Wheeler" <david@justatheory.com>) |
Список | pgsql-hackers |
On Sat, Sep 22, 2012 at 3:06 AM, David E. Wheeler <david@justatheory.com> wrote:
-- On Sep 21, 2012, at 10:59 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:I had no idea about that functionality. Seems very strange.
> I don't believe this has been thought through nearly carefully enough.
> If CREATE SCHEMA created a schema and nothing more, then the proposed
> implementation would probably be fine. But per spec, CREATE SCHEMA
> can specify not only creating the schema but a whole bunch of objects
> within the schema. As coded, if the schema exists then creation of
> the specified sub-objects is just skipped, regardless of whether they
> exist or not. I doubt that this is really sane behavior. Would the
> principle of least astonishment dictate that the IF NOT EXISTS option
> apply implicitly to each sub-object as well? (If so, we'd have to
> extend everything that can appear in OptSchemaEltList; most of those
> commands don't have IF NOT EXISTS options today.)
Isn't it this SQL?
CREATE SCHEMA foo CREATE TABLE aa (a int) CREATE TABLE bb (b int);
CREATE SCHEMA foo CREATE TABLE aa (a int) CREATE TABLE bb (b int);
Michael Paquier
http://michael.otacoo.com
В списке pgsql-hackers по дате отправления: