Skip site navigation (1) Skip section navigation (2)

Re: Getting the OID inside the executor

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: fazoolmein(at)gmail(dot)com
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Getting the OID inside the executor
Date: 2011-09-02 05:03:37
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
Fazool <fazoolmein(at)gmail(dot)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

In response to


pgsql-hackers by date

Next:From: FazoolDate: 2011-09-02 05:58:23
Subject: Re: Getting the OID inside the executor
Previous:From: FazoolDate: 2011-09-02 03:14:27
Subject: Getting the OID inside the executor

Privacy Policy | About PostgreSQL
Copyright © 1996-2018 The PostgreSQL Global Development Group