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

From: "Peter J(dot) Holzer" <hjp-pgsql(at)hjp(dot)at>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Using CTID system column as a "temporary" primary key
Date: 2023-03-29 16:43:37
Message-ID: 20230329164337.7px2drewpfrjyjqw@hjp.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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.

hp

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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Zheng Li 2023-03-29 16:53:31 Re: Support logical replication of DDLs
Previous Message Laurenz Albe 2023-03-29 15:53:08 Re: Using CTID system column as a "temporary" primary key