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

From: Maciek Sakrejda <m(dot)sakrejda(at)gmail(dot)com>
To: Sebastien Flaesch <sebastien(dot)flaesch(at)4js(dot)com>
Cc: Christophe Pettus <xof(at)thebuild(dot)com>, Geoff Winkless <pgsqladmin(at)geoff(dot)dj>, pgsql-general <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Using CTID system column as a "temporary" primary key
Date: 2023-03-28 16:45:48
Message-ID: CAOtHd0B8RihPwaE7_iO0JSe4utk=DJZ31ivic6+R7XP3E3dFUg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Note that VACUUM FULL and CLUSTER can update ctids. I don't believe regular
VACUUM can, so you should be safe from autovacuum interfering in this
scheme, but the ctid colum documentation [1] states "A primary key should
be used to identify logical rows," so this is not exactly intended usage.

Thanks,
Maciek

[1]: https://www.postgresql.org/docs/current/ddl-system-columns.html

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Rob Sargent 2023-03-28 16:49:40 Re: Cluster table based on grand parent?
Previous Message Dominique Devienne 2023-03-28 16:28:52 Re: Cluster table based on grand parent?