Re: [GENERAL] OID as Primary Key

2001-03-25 Thread Karl DeBisschop
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

Re: [GENERAL] OID as Primary Key

2001-03-22 Thread Stephan Szabo
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

RE: Re: [GENERAL] OID as Primary Key

2001-03-22 Thread Jonas Bengtsson
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

RE: Re: [GENERAL] OID as Primary Key

2001-03-22 Thread Michael Ansley
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

Re: Re: [GENERAL] OID as Primary Key

2001-03-22 Thread Brent R. Matzelle
--- 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

Re: Re: [GENERAL] OID as Primary Key

2001-03-22 Thread Jonas Bengtsson
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

Re: [GENERAL] OID as Primary Key

2001-03-22 Thread Tom Lane
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 ---

[GENERAL] OID as Primary Key

2001-03-22 Thread Jonas Bengtsson
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