Re: oids vs. serial question

From: knut(dot)suebert(at)web(dot)de
To: pgsql-general(at)postgresql(dot)org
Subject: Re: oids vs. serial question
Date: 2002-03-03 22:28:35
Message-ID: 20020303222835.GA1605@web.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ernesto E. Gutierrez 2002-03-03 22:33:46 Re: install psql 7.1.3 - rh6.2 - libreadline.so.4
Previous Message montfort 2002-03-03 20:08:39 error