Re: CREATE SCHEMA IF NOT EXISTS

Поиск
Список
Период
Сортировка
От Andrew Dunstan
Тема Re: CREATE SCHEMA IF NOT EXISTS
Дата
Msg-id 506B4D86.10306@dunslane.net
обсуждение исходный текст
Ответ на Re: CREATE SCHEMA IF NOT EXISTS  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: CREATE SCHEMA IF NOT EXISTS
Список pgsql-hackers
On 10/02/2012 03:48 PM, Tom Lane wrote:
> Alvaro Herrera <alvherre@2ndquadrant.com> writes:
>> Excerpts from David E. Wheeler's message of mar oct 02 16:16:37 -0300 2012:
>>> On Oct 2, 2012, at 12:08 PM, Alvaro Herrera <alvherre@2ndquadrant.com> wrote:
>>>> create schema if not exists foo create table first (a int);
>>>> create schema if not exists foo create table second (a int);
>>>>
>>>> As far as I can see, with the patch as it currently stands, you would
>>>> end up with only table "first" in the schema, which seems very
>>>> surprising to me.
>>> Yeah, I think the second should die. CINE should only work if there are no other objects created as part of the
statement,IMHO.
 
>> Well, if that's the rationale then you end up with no schema foo at all
>> (i.e. both die), which seems even more surprising (though I admit it has
>> the advantage of being a simple rule to document.)
> I think we should just disallow putting any contained objects in the
> statement when IF NOT EXISTS is used.  It's simple to understand, simple
> to document and implement, and I think it covers all the sane use-cases
> anyway.
>
>             

I thought we'd already agreed on this.

+1.

cheers

andrew




В списке pgsql-hackers по дате отправления:

Предыдущее
От: "David E. Wheeler"
Дата:
Сообщение: Re: CREATE SCHEMA IF NOT EXISTS
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: CREATE SCHEMA IF NOT EXISTS