Re: OID's

From: Richard Huxton <dev(at)archonet(dot)com>
To: Mihail Nasedkin <m(dot)nasedkin(dot)perm(at)mail(dot)ru>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: OID's
Date: 2005-01-21 17:04:20
Message-ID: 41F13614.8080101@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Mihail Nasedkin wrote:
> Hello, Michael.
>
> Thank you for answer January, 20 2005, 21:48:30:
>
> MF> On Thu, Jan 20, 2005 at 03:45:58PM +0500, Mihail Nasedkin wrote:
>
>
>>>How (where) I can get all OID's of the PostgeSQL
>>>installation?
>>>In other words where OID's is stored? Is it stored in special table?
>
>
> MF> See the "System Columns" section in the "Data Definition" chapter
> MF> of the PostgreSQL documentation. Tables that store objects with
> MF> OIDs should have an oid column; you could query pg_attribute to
> MF> find out what tables those are.
> I have already read about "System Columns" of the PostgreSQL documentation.
> In the table "pg_catalog.pg_attribute" column "attrelid" contain
> only "system OID's" but not OID's from records of the user tables.
>
> But I would like to use OID's of all records of the all my tables.
> ^^^ ^^^
> I try to use rules on INSERT action of my tables to store last insert
> oid, but at the moment of the INSERT row into table OID value
> inaccessible (unknown).

You are aware that OIDs aren't guaranteed to be unique, aren't you?

>>>I would like use some SQL queries with the all OID's.
>
>
> MF> To what end? Are you aware that PostgreSQL allows tables to be
> MF> created without OIDs?
> Yes, of course, but in my case I create tables with OID and then want use
> OID of all records of the all tables as one column in some query.
>
> I think what system of OID's is very useful for application!
>
> MF> What problem are you trying to solve?
> For example, I want to fetching all rows of the several tables in one
> query by means of LEFT JOIN, but not use UNION operator.

Joins are designed to be over primary keys, you should make sure you
have valid pkeys defined and use those instead.

--
Richard Huxton
Archonet Ltd

In response to

  • Re: OID's at 2005-01-21 06:17:34 from Mihail Nasedkin

Browse pgsql-sql by date

  From Date Subject
Next Message Michael Fuhr 2005-01-21 17:04:38 Re: OID's
Previous Message Joel Fradkin 2005-01-21 15:51:10 Re: still having pg_user error