More guidance on ctid - Mailing list pgsql-docs

From Bernice Southey
Subject More guidance on ctid
Date
Msg-id CAEDh4nyn5swFYuSfcnGAbpQrKOc47Hh_ZyKVSPYJcu2P=51Luw@mail.gmail.com
Whole thread Raw
Responses Re: More guidance on ctid
List pgsql-docs
Hi,
I'm wondering if the explanation of ctid in System Columns should have
more guidance - especially as it's used in examples in the UPDATE and
DELETE docs. So far I've been caught out by partitions and concurrent
updates. This was after I changed primary keys to ctid, in self-joins
that get ORDER BY or LIMIT, for UPDATE and DELETE.

I'm too unsure about this idea and my knowledge of ctid to propose a
patch, but FWIW, here's my attempt:
Ctid is useful for removing duplicate rows and efficient self-joins.
Be aware that when ctid is used to find a row, only the first
concurrent write will be applied. Also note that ctids are not unique
across table partitions.

I'm learning my way through ctid, and the mailing lists, and am still
in the foothills of both. Sorry about the topic-adjacent duplicates in
other lists from my ramblings.

Thanks, Bernice



pgsql-docs by date:

Previous
From: Laurenz Albe
Date:
Subject: Re: (docs): add missing info about ShareLocks
Next
From: Bruce Momjian
Date:
Subject: Re: More guidance on ctid