Re: [PHP] postgres - mysql last_inserted_id

2005-07-01 Thread Richard Lynch
On Fri, July 1, 2005 6:24 am, Jason Wong said: > On Friday 01 July 2005 09:55, Richard Lynch wrote: >> If there's a reliable, web-safe, connection-dependent way of getting >> the sequence ID used in an INSERT, it sure ain't documented, and I've >> never seen it discussed on the PostgreSQL list (whi

Re: [PHP] postgres - mysql last_inserted_id

2005-07-01 Thread Philip Hallstrom
OIDs *can* get re-used *IF* you end up having more than 32-bits (2 billion plus) of objects in the lifetime of your application. For normal usage, that ain't a big problem, honestly... Though I should have stated it for the record, cuz maybe the OP has a site where 2 BILLION INSERTs are gonna ha

Re: [PHP] postgres - mysql last_inserted_id

2005-07-01 Thread Martín Marqués
El Vie 01 Jul 2005 06:27, david forums escribió: > > before any insert call the id. > > select nextval('tablename_seq'); > > and pass this id to your insert. No. Best is to but a DEFAULT clause of nextval('tablename_seq') in the table definition. -- select 'mmarques' || '@' || 'unl.edu.ar' A

Re: [PHP] postgres - mysql last_inserted_id

2005-07-01 Thread Jason Wong
On Friday 01 July 2005 09:55, Richard Lynch wrote: > There are innumerable on-line forums that (incorrectly) state that an > OID could be returned that is not connection-specific, so two HTTP > requests in parallel would criss-cross OIDs. > > This is patently false, and any user of PostgreSQL can

Re: [PHP] postgres - mysql last_inserted_id

2005-07-01 Thread david forums
Hi I'm migrating also to posgresql. The easyest way to manage incrementation with postgres is to use sequences. How to : Create a sequence for each table that need autoincrementation. use pgMyAdmin, to make all needed changes before any insert call the id. select nextval('tablename_seq');

Re: [PHP] postgres - mysql last_inserted_id

2005-06-30 Thread Richard Lynch
On Thu, June 30, 2005 2:17 pm, Jason Wong said: > On Friday 01 July 2005 04:06, Richard Lynch wrote: > >> > last >> > record from the tabel, for linking to another tabel. >> >> You have to use http://php.net/pg_last_oid to get the PostgreSQL >> "internal" Object ID (OID) -- You can then use the ubi

Re: [PHP] postgres - mysql last_inserted_id

2005-06-30 Thread Jason Wong
On Friday 01 July 2005 04:06, Richard Lynch wrote: > > last > > record from the tabel, for linking to another tabel. > > You have to use http://php.net/pg_last_oid to get the PostgreSQL > "internal" Object ID (OID) -- You can then use the ubiquitous "oid" > column. > > > $query = "insert ..."; > p

Re: [PHP] postgres - mysql last_inserted_id

2005-06-30 Thread Jason Wong
On Friday 01 July 2005 02:55, Uroš Kristan wrote: > I have an application in production, build on mysql database. > > I decided to migrate to postgres because of numerous reasons. Good idea :) > Can you guys please guide me into the right direction? > > the main problem is the missing autoincre

Re: [PHP] postgres - mysql last_inserted_id

2005-06-30 Thread Richard Lynch
On Thu, June 30, 2005 11:55 am, Uro¹ Kristan said: > I have an application in production, build on mysql database. > > I decided to migrate to postgres because of numerous reasons. > > Can you guys please guide me into the right direction? > > the main problem is the missing autoincrement of pgsql

[PHP] postgres - mysql last_inserted_id

2005-06-30 Thread Uroš Kristan
Hello, I have an application in production, build on mysql database. I decided to migrate to postgres because of numerous reasons. Can you guys please guide me into the right direction? the main problem is the missing autoincrement of pgsql and getting the last record from the tabel, for li