pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedusing OID as primary key
3+ messages / 3 participants
[nested] [flat]
* using OID as primary key
@ 2000-07-21 11:47 Markus Wagner <wagner@imsd.uni-mainz.de>
0 siblings, 1 reply; 3+ messages in thread
From: Markus Wagner @ 2000-07-21 11:47 UTC (permalink / raw)
To: pgsql-sql
Hi,
are there any disadvantages of using OID as the primary key for any
table?
What about referencing external tuples using their OIDs?
e. g.:
CREATE TABLE thistable
...
field NUMERIC REFERENCES OtherTable (oid)
Which data type should I use to reference OIDs?
Will I run into problems later if I do my things this way?
Thanks,
Markus
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: using OID as primary key
@ 2000-07-21 11:57 Jan Wieck <JanWieck@t-online.de>
parent: Markus Wagner <wagner@imsd.uni-mainz.de>
0 siblings, 1 reply; 3+ messages in thread
From: JanWieck@t-online.de @ 2000-07-21 11:57 UTC (permalink / raw)
To: wagner@imsd.uni-mainz.de; +Cc: pgsql-sql
Markus Wagner wrote:
> Hi,
>
> are there any disadvantages of using OID as the primary key for any
> table?
> What about referencing external tuples using their OIDs?
>
> e. g.:
> CREATE TABLE thistable
> ...
> field NUMERIC REFERENCES OtherTable (oid)
>
> Which data type should I use to reference OIDs?
>
> Will I run into problems later if I do my things this way?
Currently OID is not supported for references. Has to do with
some checks done in the RI triggers, using SPI functions.
We're thinking about a solution...
Jan
--
#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me. #
#================================================== JanWieck@Yahoo.com #
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: using OID as primary key
@ 2000-07-21 13:58 D'Arcy J.M. Cain <darcy@druid.net>
parent: Jan Wieck <JanWieck@t-online.de>
0 siblings, 0 replies; 3+ messages in thread
From: darcy@druid.net @ 2000-07-21 13:58 UTC (permalink / raw)
To: Jan Wieck <JanWieck@Yahoo.com>; +Cc: pgsql-sql
Thus spake Jan Wieck
> > are there any disadvantages of using OID as the primary key for any
> > table?
> > What about referencing external tuples using their OIDs?
>
> Currently OID is not supported for references. Has to do with
> some checks done in the RI triggers, using SPI functions.
> We're thinking about a solution...
Also, don't forget about the dump/restore issue. You have to remember
to dump OIDs with "-o" or else all your references will be trashed.
<OPINION>
Personally I would avoid it. Adding a serial type almost gives you
the same thing anyway. OIDs are useful in system tables and temporarily
in programs when dealing with tables without primary keys.
</OPINION>
--
D'Arcy J.M. Cain <darcy@{druid|vex}.net> | Democracy is three wolves
http://www.druid.net/darcy/ | and a sheep voting on
+1 416 425 1212 (DoD#0082) (eNTP) | what's for dinner.
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2000-07-21 13:58 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2000-07-21 11:47 using OID as primary key Markus Wagner <wagner@imsd.uni-mainz.de>
2000-07-21 11:57 ` Jan Wieck <JanWieck@t-online.de>
2000-07-21 13:58 ` D'Arcy J.M. Cain <darcy@druid.net>
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