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: | 5085.1314939817@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
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
From | Date | Subject | |
---|---|---|---|
Next Message | Fazool | 2011-09-02 05:58:23 | Re: Getting the OID inside the executor |
Previous Message | Fazool | 2011-09-02 03:14:27 | Getting the OID inside the executor |