Re: Re: OID as Primary Key

Поиск
Список
Период
Сортировка
От Jonas Bengtsson
Тема Re: Re: OID as Primary Key
Дата
Msg-id 985274741.141jonas.b@home.se
обсуждение исходный текст
Ответ на OID as Primary Key  (Jonas Bengtsson <jonas.b@home.se>)
Ответы Re: Re: OID as Primary Key
Список pgsql-general
Can't you do a dump with the oid's?

But when I want to know the primary key of the inserted row
I have to do an extra select query. If I use oid I just use
pg_getlastoid() in php.
And it is redundant data to store another integer.

Comments?

/Jonas B

> Jonas Bengtsson <jonas.b@home.se> writes:
> > I have problems with using OID as PK.
>
> This strikes me as a fairly bad idea in any case.  What
happens if you
> must dump and reload your database?  Better to use a
SERIAL column as
> primary key.
>
>             regards, tom lane
>



Mvh,
Jonas Bengtsson


В списке pgsql-general по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: non-existent user "28"
Следующее
От: Peter Choe
Дата:
Сообщение: creating a trigger to write to a different table