Sample Header Ad - 728x90

What is the data type of the ‘ctid’ system column in Postgres?

26 votes
2 answers
26183 views
The Postgres system columns are documented in [*Chapter 5. Data Definition > 5.4. System Columns*](https://www.postgresql.org/docs/current/static/ddl-system-columns.html) . That page mentions that oid values “are 32-bit quantities”. And that page says the same about transaction identifiers. So I will assume that means oid, tableoid, xmin, cmin, xmax, and cmax are all 32-bit integers. But that leaves the ctid system column. >The physical location of the row version within its table. Note that although the ctid can be used to locate the row version very quickly, a row's ctid will change if it is updated or moved by VACUUM FULL. Therefore ctid is useless as a long-term row identifier. The OID, or even better a user-defined serial number, should be used to identify logical rows. ➡ What is the data type of the ctid column? Specifically I am interested in version Postgres 10.3, but if it has changed over past versions, that would be good to know.
Asked by Basil Bourque (11188 rep)
Apr 15, 2018, 04:26 AM
Last activity: Jan 8, 2022, 02:59 AM