Re: Using CTID system column as a "temporary" primary key

Поиск
Список
Период
Сортировка
От Adrian Klaver
Тема Re: Using CTID system column as a "temporary" primary key
Дата
Msg-id 8708606d-e6f2-07f5-b374-465224de9c66@aklaver.com
обсуждение исходный текст
Ответ на Re: Using CTID system column as a "temporary" primary key  ("Peter J. Holzer" <hjp-pgsql@hjp.at>)
Ответы Re: Using CTID system column as a "temporary" primary key  ("Peter J. Holzer" <hjp-pgsql@hjp.at>)
Список pgsql-general
On 3/29/23 09:43, Peter J. Holzer wrote:
> On 2023-03-29 07:59:54 -0700, Adrian Klaver wrote:
>> On 3/29/23 07:19, Sebastien Flaesch wrote:
>>> INSERT statements must not use the serial column, so you have to list
>>> all columns of the table and provide only the values of the non-serial
>>> columns. With Informix you could just specific a zero to get a new
>>> generated serial, but seems this has never been considered with
>>> PostgreSQL.
>>
>> Yes it has:
> [...]
>> insert into seq_test values(default, 'test');
> 
> Default is not the same as zero.

It accomplishes the same thing, a place holder value can be used to fire 
the sequence without column qualifying the insert/update. Furthermore it 
works over all columns. So I would say it has been considered by 
Postgres as a way to 'to get a new generated serial'.

> 
>          hp
> 

-- 
Adrian Klaver
adrian.klaver@aklaver.com




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

Предыдущее
От: Sebastien Flaesch
Дата:
Сообщение: Re: Using CTID system column as a "temporary" primary key
Следующее
От: Christophe Pettus
Дата:
Сообщение: Re: Using CTID system column as a "temporary" primary key