Thread: [INIMSS] How to use OID?
Hi, Is there any real use of the data-type OID? Can I use it as a primary key? Please an example for its use. Thanks Dino
Dino, > Is there any real use of the data-type OID? > Can I use it as a primary key? This sort of question belongs on the NOVICE list, not SQL. In answer: Don't use the OID. Create your own primary key, using theSERIAL data type. -Josh ______AGLIO DATABASE SOLUTIONS___________________________ Josh Berkus Complete informationtechnology josh@agliodbs.com and data management solutions (415) 565-7293 for law firms, small businesses fax 621-2533 and non-profit organizations. San Francisco
> Is there any real use of the data-type OID? There's plenty of uses, however if you don't need to use it, don't use it. > Can I use it as a primary key? Yes, but I recommend against it, because OIDs are easily lost after a database restore... Chris
> > Can I use it as a primary key? > > Yes, but I recommend against it, because OIDs are easily lost after a > database restore... > i use OIDs to refer to unique records instead of using 3 or more composite keys in the table for some processing. ANd it's wise to index the oid field also. But i dont use it as a primary key... as stated above. -herbert