postgres CTID - ghdrako/doc_snipets GitHub Wiki

CTID” field in PostgreSQL which is equivalent to “ROWID” in Oracle.

The “CTID” field is a field that exists in every PostgresSQL table, it is always unique for each and every record in the table. It denotes the Physical location of the data.

One of the main advantages of having “CTID” in PostgreSQL is denoting the Physical location and providing an idea of how the rows are actually stored in a database table.

select ctid, id from information limit 5;
(0,1) , 1

value (0,1) here, the first digit 0 represents the page number, and the second 1 represents the tuple number. “CTID” field values are always sequential and unique. We can reset the “CTID” values by running “VACUUM FULL” on the table.