Re: Using CTID system column as a "temporary" primary key
От | Sebastien Flaesch |
---|---|
Тема | Re: Using CTID system column as a "temporary" primary key |
Дата | |
Msg-id | DBAP191MB128940FF558474BC6DA80CB7B0889@DBAP191MB1289.EURP191.PROD.OUTLOOK.COM обсуждение исходный текст |
Ответ на | Re: Using CTID system column as a "temporary" primary key (Christophe Pettus <xof@thebuild.com>) |
Ответы |
Re: Using CTID system column as a "temporary" primary key
|
Список | pgsql-general |
CAST seems to do the job so that's a good solution here.
Seb
From: Christophe Pettus <xof@thebuild.com>
Sent: Tuesday, March 28, 2023 2:39 PM
To: Sebastien Flaesch <sebastien.flaesch@4js.com>
Cc: Geoff Winkless <pgsqladmin@geoff.dj>; pgsql-general <pgsql-general@lists.postgresql.org>
Subject: Re: Using CTID system column as a "temporary" primary key
Sent: Tuesday, March 28, 2023 2:39 PM
To: Sebastien Flaesch <sebastien.flaesch@4js.com>
Cc: Geoff Winkless <pgsqladmin@geoff.dj>; pgsql-general <pgsql-general@lists.postgresql.org>
Subject: Re: Using CTID system column as a "temporary" primary key
EXTERNAL: Do not click links or open attachments if you do not recognize the sender.
> On Mar 28, 2023, at 03:39, Sebastien Flaesch <sebastien.flaesch@4js.com> wrote:
> Do I have to cast() ?
Yes:
select * from t where ctid='(0,1)'::tid;
The string representation can be up to 17 characters: 10 for the page number, 4 for the tuple number, and three for the delimiters.
Remember that updating a row changes its CTID.
> On Mar 28, 2023, at 03:39, Sebastien Flaesch <sebastien.flaesch@4js.com> wrote:
> Do I have to cast() ?
Yes:
select * from t where ctid='(0,1)'::tid;
The string representation can be up to 17 characters: 10 for the page number, 4 for the tuple number, and three for the delimiters.
Remember that updating a row changes its CTID.
В списке pgsql-general по дате отправления: