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

using oids as primary keys and foreign keys

From: David Bear <David(dot)Bear(at)asu(dot)edu>
To: pgsql-admin(at)postgresql(dot)org
Subject: using oids as primary keys and foreign keys
Date: 2004-11-08 22:36:26
Message-ID: 20041108223626.GA24870@asu.edu (view raw or flat)
Thread:
Lists: pgsql-admin
I've looked in the archives searching on oid and 'access' (microsoft)
to see how others have handled migration from data bases in ms-access
to postgresql. MS access has an auto-inc field that is used frequently
as a uniq id.  Seems the OID has the same function. Yet, I've seem
parts of messages that say not to use the OID in that manner, but
nothing seems 'definitive'.

Can I use an OID as a foreign key in another table? 

If not, what is the prefered method for replicating the auto-inc field
that ms-access users are so fond of... a 'sequence'?


-- 
David Bear
phone: 	480-965-8257
fax: 	480-965-9189
College of Public Programs/ASU
Wilson Hall 232
Tempe, AZ 85287-0803
 "Beware the IP portfolio, everyone will be suspect of trespassing"

Responses

pgsql-admin by date

Next:From: Paul B. AndersonDate: 2004-11-08 22:58:12
Subject: Large transaction problem
Previous:From: Michael HippDate: 2004-11-08 21:37:51
Subject: Re: psql won't accept pg_dump

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