Thread: [INIMSS] How to use OID?

[INIMSS] How to use OID?

From
Dino Cherian K
Date:
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


Re: [INIMSS] How to use OID?

From
"Josh Berkus"
Date:
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
 


Re: [INIMSS] How to use OID?

From
"Christopher Kings-Lynne"
Date:
> 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



Re: [INIMSS] How to use OID?

From
Herbert Rabago Ambos
Date:
> > 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