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

Поиск
Список
Период
Сортировка
От Peter J. Holzer
Тема Re: Using CTID system column as a "temporary" primary key
Дата
Msg-id 20230330162153.mujoqy7rg4vwixlv@hjp.at
обсуждение исходный текст
Ответ на Re: Using CTID system column as a "temporary" primary key  (Adrian Klaver <adrian.klaver@aklaver.com>)
Список pgsql-general
On 2023-03-29 12:15:09 -0700, Adrian Klaver wrote:
> 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,

No. As has been pointed out by others, default is keyword. Unlike 0 (or
NULL) you can't bind it, You can argue that that would be a bad idea
anyway (and in most - maybe all - cases I'd agree with you), but I
consider that a pretty fundamental difference.

        hp

--
   _  | Peter J. Holzer    | Story must make more sense than reality.
|_|_) |                    |
| |   | hjp@hjp.at         |    -- Charles Stross, "Creative writing
__/   | http://www.hjp.at/ |       challenge!"

Вложения

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: libpq: COPY FROM STDIN BINARY of arrays
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Multilang text search. Is this correct?