pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
[INIMSS] How to use OID?
4+ messages / 4 participants
[nested] [flat]

* [INIMSS] How to use OID?
@ 2002-03-13 11:43  Dino Cherian K <inimss@yahoo.com>
  0 siblings, 2 replies; 4+ messages in thread

From: Dino Cherian K @ 2002-03-13 11:43 UTC (permalink / raw)
  To: pgsql-sql

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



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: [INIMSS] How to use OID?
@ 2002-03-13 17:38  Josh Berkus <josh@agliodbs.com>
  parent: Dino Cherian K <inimss@yahoo.com>
  1 sibling, 0 replies; 4+ messages in thread

From: Josh Berkus @ 2002-03-13 17:38 UTC (permalink / raw)
  To: Dino Cherian K <inimss@yahoo.com>; pgsql-sql

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 the
 SERIAL data type.

-Josh

______AGLIO DATABASE SOLUTIONS___________________________
                                       Josh Berkus
  Complete information technology      josh@agliodbs.com
   and data management solutions       (415) 565-7293
  for law firms, small businesses        fax 621-2533
    and non-profit organizations.      San Francisco



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: [INIMSS] How to use OID?
@ 2002-03-14 01:29  Christopher Kings-Lynne <chriskl@familyhealth.com.au>
  parent: Dino Cherian K <inimss@yahoo.com>
  1 sibling, 1 reply; 4+ messages in thread

From: Christopher Kings-Lynne @ 2002-03-14 01:29 UTC (permalink / raw)
  To: Dino Cherian K <inimss@yahoo.com>; pgsql-sql

> 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




^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: [INIMSS] How to use OID?
@ 2002-03-14 02:09  Herbert Rabago Ambos <herbert@hindang.msuiit.edu.ph>
  parent: Christopher Kings-Lynne <chriskl@familyhealth.com.au>
  0 siblings, 0 replies; 4+ messages in thread

From: Herbert Rabago Ambos @ 2002-03-14 02:09 UTC (permalink / raw)
  To: pgsql-sql


> > 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




^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2002-03-14 02:09 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2002-03-13 11:43 [INIMSS] How to use OID? Dino Cherian K <inimss@yahoo.com>
2002-03-13 17:38 ` Josh Berkus <josh@agliodbs.com>
2002-03-14 01:29 ` Christopher Kings-Lynne <chriskl@familyhealth.com.au>
2002-03-14 02:09   ` Herbert Rabago Ambos <herbert@hindang.msuiit.edu.ph>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox