Re: oids vs. serial question - Mailing list pgsql-general

From knut.suebert@web.de
Subject Re: oids vs. serial question
Date
Msg-id 20020303222835.GA1605@web.de
Whole thread Raw
In response to oids vs. serial question  (Alex Rice <alex_rice@arc.to>)
List pgsql-general
Alex Rice schrieb:
> I am considering using OIDs for my application. I like the fact that
> they are just automagic. However, the magic seems to disappear when it

Hi,

as far as I understood the thing, take OIDs as 'internal' (they are
unique all over all databases) and do not use them to organize your
data.

> CREATE TABLE park (
>   region_oid oid references region,
>   primary key (oid),
> ...
> );
>
> CREATE TABLE region (
>   PRIMARY KEY  (oid),
> ...
> ) ;

Something like

  CREATE TABLE park (
    id serial primary key,
    region int4 references region,
    ...
  );

  CREATE TABLE region (
    id serial primary key,
    ...
  ) ;

should work.

Is SERIAL still INT4 in v7.2?

Bye,
Knut Sübert

pgsql-general by date:

Previous
From: missive@frontiernet.net (Lee Harr)
Date:
Subject: Re: Newbie question re SQL
Next
From: "Miguel A." Arévalo
Date:
Subject: Re: Clues about tables fileformat