Jonas Bengtsson wrote:
>
> 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?
I have often
On Thu, 22 Mar 2001, Jonas Bengtsson wrote:
> Hello,
> I have problems with using OID as PK. I have created a
> UNIQUE INDEX on the oid on a relation called CourseEvents.
> The relation that is supposed to have a FK to CourseEvents
> is CourseEventsForums and it has a field called ceid which
Title: RE: Re: [GENERAL] OID as Primary Key
Isn’t is better to use nextval(). If there are many simultaneous
users vurrval might give the value of another insert.
/Jonas B
-Original
Message-
From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Michael
Title: RE: Re: [GENERAL] OID as Primary Key
And you can get the last SERIAL inserted using currval.
MikeA
>> -Original Message-
>> From: Brent R. Matzelle [mailto:[EMAIL PROTECTED]]
>> Sent: 22 March 2001 16:36
>> To: [EMAIL PROTECTED]
>> Sub
--- Jonas Bengtsson <[EMAIL PROTECTED]> 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 d
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 <[EMAIL PROTECTED]> wri
Jonas Bengtsson <[EMAIL PROTECTED]> 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
---
Hello,
I have problems with using OID as PK. I have created a
UNIQUE INDEX on the oid on a relation called CourseEvents.
The relation that is supposed to have a FK to CourseEvents
is CourseEventsForums and it has a field called ceid which
has oid as dtatype.
But when I try to create a FK to t