Re: [GENERAL] Using oid as pkey

2007-08-21 Thread hubert depesz lubaczewski
On Mon, Aug 20, 2007 at 07:00:32PM -0500, D. Dante Lorenso wrote: > Exactly what I was looking for. Looks like I need to make moves to get > from 8.1 onto 8.2 ;-) in any pg you should simply use select currval('sequence_name'); and be happy with it. depesz -- quicksil1er: "postgres is excelle

Re: [GENERAL] Using oid as pkey

2007-08-20 Thread D. Dante Lorenso
Rainer Bauer wrote: "D. Dante Lorenso" wrote: Using a brain-dead sample table that looks like this: CREATE table some_table ( col0 SERIAL, col1 VARCHAR, col2 VARCHAR ); I want to do something like this: INSERT INTO some_

Re: [GENERAL] Using oid as pkey

2007-08-20 Thread Rainer Bauer
"D. Dante Lorenso" wrote: >Using a brain-dead sample table that looks like this: > > CREATE table some_table ( > col0 SERIAL, > col1 VARCHAR, > col2 VARCHAR > ); > >I want to do something like this: > > INSERT INTO some_table (col1, col2)

Re: [GENERAL] Using oid as pkey

2007-08-20 Thread Alvaro Herrera
D. Dante Lorenso wrote: > I want the value of col0 returned to the application and I don't want to > know the name of the sequence involved in the SERIAL column. I just want > the value inserted into the column by using just it's column name. Use pg_get_serial_sequence(). Don't use lastval()

Re: [GENERAL] Using oid as pkey

2007-08-20 Thread Michael Glaesemann
On Aug 20, 2007, at 17:51 , D. Dante Lorenso wrote: Michael Glaesemann wrote: On Aug 20, 2007, at 16:58 , Ed L. wrote: You'd have to specify your table WITH OIDS anyway as they're no longer used by default for table rows, so there's really nothing to be gained by using oids. How exactly

Re: [GENERAL] Using oid as pkey

2007-08-20 Thread Joshua D. Drake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 D. Dante Lorenso wrote: > Michael Glaesemann wrote: >> >> On Aug 20, 2007, at 16:58 , Ed L. wrote: >> You'd have to specify your table WITH OIDS anyway as they're no >> longer used by default for table rows, so there's really nothing to be >> gained b

Re: [GENERAL] Using oid as pkey

2007-08-20 Thread D. Dante Lorenso
Michael Glaesemann wrote: On Aug 20, 2007, at 16:58 , Ed L. wrote: You'd have to specify your table WITH OIDS anyway as they're no longer used by default for table rows, so there's really nothing to be gained by using oids. How exactly can you get rid of OIDs when using a language like PHP?

Re: [GENERAL] Using oid as pkey

2007-08-20 Thread Scott Marlowe
On 8/20/07, Michael Glaesemann <[EMAIL PROTECTED]> wrote: > > On Aug 20, 2007, at 16:58 , Ed L. wrote: > > > What are the concerns with using oid as the column for a primary > > key declaration for use in trigger-based replication? > > Just don't. oids are intended to be used by the database server

Re: [GENERAL] Using oid as pkey

2007-08-20 Thread Michael Glaesemann
On Aug 20, 2007, at 16:58 , Ed L. wrote: What are the concerns with using oid as the column for a primary key declaration for use in trigger-based replication? Just don't. oids are intended to be used by the database server itself rather than as part of the user-defined data. If you're lo

[GENERAL] Using oid as pkey

2007-08-20 Thread Ed L.
What are the concerns with using oid as the column for a primary key declaration for use in trigger-based replication? TIA, Ed ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org/