Uniquness of ctid

Started by PG Bug reporting formalmost 3 years ago2 messagesdocs
Jump to latest
#1PG Bug reporting form
noreply@postgresql.org

The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/15/ddl-system-columns.html
Description:

Hi,
Looking at the explanation abour ctid, it is "The physical location of the
row version within its table. "
From that line, I think ctid is unique in the table.
And I also think ctid might be unique across the database since it is the
physical location.
But I was not sure about this.
Please confirm if my assumption is right or not.

Thanks
Brian

#2David G. Johnston
david.g.johnston@gmail.com
In reply to: PG Bug reporting form (#1)
Re: Uniquness of ctid

On Wed, Jul 19, 2023 at 2:31 PM PG Doc comments form <noreply@postgresql.org>
wrote:

The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/15/ddl-system-columns.html
Description:

Hi,
Looking at the explanation abour ctid, it is "The physical location of the
row version within its table. "
From that line, I think ctid is unique in the table.

Unique but not stable - if you give your actual record an ID value the
associated ctid for it may very well change over time and a given ctid can
be associated with any number of IDs

And I also think ctid might be unique across the database since it is the
physical location.

The concept doesn't even apply - the value itself only makes sense within a
given physical table. i.e., the table is implied. It's like saying "I live
at 123 Main St." to someone. Sure in any given place there can only be a
single 123 Main St. but that really isn't useful by itself. And to extend
back to the previous point, you may live there now but you will likely have
a different address in the future and someone else will have 123 Main St.

David J.