<not repeating alot of stuff>

Each record has an oid, which is assured to be unique in that
database.  Thus you can use it for your purpose, I believe.  To fine
the oid with any record, just:

SELECT oid,* from mytable;

The OID is always there, and you don't have to add it - you just don't
see it uless you specifically ask for it.

The if you are creating another table that links to the OIDs of
mytable, say as 

CREATE TABLE anothertable (firstcol int4, pointer_to_mytable oid,
thirdcol text);

Then you can use the oids you selected above.  As I mentioned before,
see perldoc DBI::Pg for perl interface to the last inserted oid, and
the PHP manual for PHP's equivalent.  C lib and other interfaces can
also do this - I just don't know exactly wher ethat documentation is.

The OID will never change.  With one caveat.  If you dump/restore a
database, you must use -o on pg_dump to preserve OIDs

Hope this clarifies.

-- 
Karl DeBisschop <[EMAIL PROTECTED]>
617.832.0332 (Fax: 617.956.2696)

Information Please - your source for FREE online reference
http://www.infoplease.com  - Your Ultimate Fact Finder
http://kids.infoplease.com - The Great Homework Helper

Reply via email to