OIDs

PostgreSQL makes use of object identifiers (OIDs) and temporary identifiers (TIDs) to correlate table rows with system tables and temporary index entries.

Every row inserted into a table in PostgreSQL has a unique OID associated with it. In fact, every table in PostgreSQL contains a hidden column named oid. For instance:

SELECT * FROM authors; 

Name              Title 
---------------------------------------------------
Bill Smith        Cooking for 6 Billion 
Sam Jones         Chicken Soup for the Publishers Soul 
SELECT oid, * FROM authors; 

Oid   Name              Title 
------------------------------------------------------------
17887 Bill Smith        Cooking for 6 Billion 
18758 Sam Jones         Chicken Soup for the Publishers Soul 

The key concept to understand with OIDs is that they are not ...

Get PostgreSQL Essential Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.