Re: Re: OID as Primary Key

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

Yes, but I would never suggest it.

> 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.

You should not use oid's as primary keys just because you want
to save a little HD space.

I contributed a some code on PHPBuilder for a function that
returns the insert id of a SERIAL primary key.  You can view it
here:
http://www.phpbuilder.com/snippet/download.php?type=snippet&id=304
.  It works well for me and it does not kludge my code like
using the oid does.

Brent

__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail.
http://personal.mail.yahoo.com/

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

Предыдущее
От: "Brent R.Matzelle"
Дата:
Сообщение: Re: Changing from rpm to Compiled version
Следующее
От: Michael Ansley
Дата:
Сообщение: RE: Re: OID as Primary Key