Re: Getting the OID inside the executor - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Getting the OID inside the executor
Date
Msg-id 5085.1314939817@sss.pgh.pa.us
Whole thread Raw
In response to Getting the OID inside the executor  (Fazool <fazoolmein@gmail.com>)
Responses Re: Getting the OID inside the executor
List pgsql-hackers
Fazool <fazoolmein@gmail.com> writes:
> I am implementing some functionality into Postgresql, where I want to
> track which row was accessed by a user query. I am implementing the
> functionality inside Postgres, so that there are no changes required
> on client side (e.g. re-writing queries).
> Rows are identified by OIDs, and I have set default_with_oids=true, so
> that all tables are created with OIDs.

It's a serious, serious error to suppose that OIDs are adequate
identifiers for rows in user tables.

We use OIDs to identify rows in system catalogs.  We can get away with
that, more or less, because (a) system catalogs are not likely to
contain billions of rows, and (b) we place a unique index on OID on
every system catalog that has OIDs.  Neither of these statements is
very tenable for user tables.

You haven't said anything about what it is you actually need to
accomplish here, but can you use TIDs as row identifiers?  What's
the required lifetime of the identifiers?
        regards, tom lane


pgsql-hackers by date:

Previous
From: Fazool
Date:
Subject: Getting the OID inside the executor
Next
From: Fazool
Date:
Subject: Re: Getting the OID inside the executor