From: | Mitch Pirtle <mitch(dot)pirtle(at)gmail(dot)com> |
---|---|
To: | "operationsengineer1(at)yahoo(dot)com" <operationsengineer1(at)yahoo(dot)com> |
Cc: | pgsql-novice(at)postgresql(dot)org |
Subject: | Re: Last ID Problem |
Date: | 2005-01-31 22:50:33 |
Message-ID: | 330532b605013114506f02ebaf@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers pgsql-novice |
This is the easiest way to do it:
http://ask.slashdot.org/article.pl?sid=05/01/31/1441200&from=rss
This is using plain old SQL the PostgreSQL way ;-)
Basically you:
1) get the next number from the sequence
2) do the update
3) use that number for related table insterts
For an ADOdb example, this thread:
http://www.phparch.com/discuss/index.php/t/372/0/
Says to use this syntax:
$insert_id = $db->getone("select currval('sequence_name')");
-- Mitch
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2005-01-31 22:52:40 | Re: [BUGS] Bug in create operator and/or initdb |
Previous Message | Paul Vixie | 2005-01-31 22:44:38 | Re: [BUGS] Bug in create operator and/or initdb |
From | Date | Subject | |
---|---|---|---|
Next Message | operationsengineer1 | 2005-01-31 23:33:02 | Re: Last ID Problem |
Previous Message | operationsengineer1 | 2005-01-31 21:01:52 | Re: Last ID Problem |