Re: oids vs. serial question

Поиск
Список
Период
Сортировка
От knut.suebert@web.de
Тема Re: oids vs. serial question
Дата
Msg-id 20020303222835.GA1605@web.de
обсуждение исходный текст
Ответ на oids vs. serial question  (Alex Rice <alex_rice@arc.to>)
Список 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 по дате отправления:

Предыдущее
От: missive@frontiernet.net (Lee Harr)
Дата:
Сообщение: Re: Newbie question re SQL
Следующее
От: "Miguel A." Arévalo
Дата:
Сообщение: Re: Clues about tables fileformat