Обсуждение: [INIMSS] How to use OID?

Поиск
Список
Период
Сортировка

[INIMSS] How to use OID?

От
Dino Cherian K
Дата:
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?

От
"Josh Berkus"
Дата:
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?

От
"Christopher Kings-Lynne"
Дата:
> 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?

От
Herbert Rabago Ambos
Дата:
> > 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