pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Sebastien Flaesch <sebastien.flaesch@4js.com>
To: Christophe Pettus <xof@thebuild.com>
Cc: Geoff Winkless <pgsqladmin@geoff.dj>
Cc: pgsql-general <pgsql-general@lists.postgresql.org>
Subject: Re: Using CTID system column as a "temporary" primary key
Date: Tue, 28 Mar 2023 14:23:06 +0000
Message-ID: <DBAP191MB128940FF558474BC6DA80CB7B0889@DBAP191MB1289.EURP191.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <BDED177C-F85C-4667-A67C-C083DD76A9E2@thebuild.com>
References: <DBAP191MB12891F47802C3674F77BF751B0889@DBAP191MB1289.EURP191.PROD.OUTLOOK.COM>
	<CAEzk6feEGHzS_TexvevFmWhsYt7MYhUUEUE54stO7SPNbL_Ypg@mail.gmail.com>
	<DBAP191MB1289536BFF22FD8BD5FFEC61B0889@DBAP191MB1289.EURP191.PROD.OUTLOOK.COM>
	<BDED177C-F85C-4667-A67C-C083DD76A9E2@thebuild.com>

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

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.

view thread (28+ messages)  latest in thread

Message-ID: <DBAP191MB128940FF558474BC6DA80CB7B0889@DBAP191MB1289.EURP191.PROD.OUTLOOK.COM>
Permalink:  ../DBAP191MB128940FF558474BC6DA80CB7B0889@DBAP191MB1289.EURP191.PROD.OUTLOOK.COM/
Also on:    postgresql.org/message-id/DBAP191MB128940FF558474BC6DA80CB7B0889@DBAP191MB1289.EURP191.PROD.OUTLOOK.COM

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: sebastien.flaesch@4js.com, xof@thebuild.com, pgsqladmin@geoff.dj
  Subject: Re: Using CTID system column as a "temporary" primary key
  In-Reply-To: <DBAP191MB128940FF558474BC6DA80CB7B0889@DBAP191MB1289.EURP191.PROD.OUTLOOK.COM>
  References: <DBAP191MB12891F47802C3674F77BF751B0889@DBAP191MB1289.EURP191.PROD.OUTLOOK.COM> <CAEzk6feEGHzS_TexvevFmWhsYt7MYhUUEUE54stO7SPNbL_Ypg@mail.gmail.com> <DBAP191MB1289536BFF22FD8BD5FFEC61B0889@DBAP191MB1289.EURP191.PROD.OUTLOOK.COM> <BDED177C-F85C-4667-A67C-C083DD76A9E2@thebuild.com> <DBAP191MB128940FF558474BC6DA80CB7B0889@DBAP191MB1289.EURP191.PROD.OUTLOOK.COM>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox