Re: [HACKERS] identity columns

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: [HACKERS] identity columns
Дата
Msg-id CA+TgmoY3coh329FX6c-iFLYcCSDc46eZZ5_SB1hh7zMus1Qp3w@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [HACKERS] identity columns  (Vitaly Burovoy <vitaly.burovoy@gmail.com>)
Список pgsql-hackers
On Sun, Apr 23, 2017 at 9:03 PM, Vitaly Burovoy
<vitaly.burovoy@gmail.com> wrote:
>> But why do we need it?  Instead of:
>>
>> ADD GENERATED { ALWAYS | BY DEFAULT } AS IDENTITY
>> SET GENERATED { ALWAYS | BY DEFAULT }
>> DROP IDENTITY [ IF EXISTS ]
>>
>> Why not just:
>>
>> SET GENERATED { ALWAYS | BY DEFAULT } AS IDENTITY
>> DROP IDENTITY [ IF EXISTS ]
>>
>> Surely the ALTER TABLE command can tell whether the column is already
>> GENERATED, so the first form could make it generated if it's not and
>> adjust the ALWAYS/BY DEFAULT property if it is.
>
> I thought exactly that way, but Peter gave an explanation[1].

That's not really an explanation.  Peter says he needs ADD to make
pg_dump, but he doesn't really.  He just needs something that adds it,
and augmenting SET to perform ADD if the sequence is not currently
GENERATED would be fine.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



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

Предыдущее
От: Craig Ringer
Дата:
Сообщение: Re: [HACKERS] OK, so culicidae is *still* broken
Следующее
От: Robert Haas
Дата:
Сообщение: Re: [HACKERS] TAP tests - installcheck vs check