From: | harrold(at)sage(dot)che(dot)pitt(dot)edu |
---|---|
To: | |
Cc: | Pgsql Novice <pgsql-novice(at)postgresql(dot)org> |
Subject: | Re: nextval/dbi question |
Date: | 2001-08-06 00:20:16 |
Message-ID: | Pine.LNX.4.21.0108052018030.30525-100000@sage.che.pitt.edu |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-novice |
hey.
that's just dandy-it works fine. thanks everyone for helping me sort out
my misunderstanings.
--
john
There is no operating system but linux and linus is its kernel maintainer.
Sometime in August Tom Lane assaulted keyboard and produced...
|harrold(at)sage(dot)che(dot)pitt(dot)edu writes:
|> i want to insert data into a table that has a serialized key. then i want
|> the value of the key for the row i just inserted. from the stuff i read
|> on the net i though i was supposed to run the nextval command first then
|> preform the insert.
|
|That is about the simplest and most obvious way to do it, IMHO. What
|you're missing is that you have to explicitly insert the value you got
|from nextval() into the key column. If you allow the key column to be
|defaulted in the INSERT, then nextval() gets run again.
|
| regards, tom lane
|
From | Date | Subject | |
---|---|---|---|
Next Message | Gaetan GUYODO | 2001-08-06 08:37:52 | Index and primary key |
Previous Message | Tom Lane | 2001-08-05 23:09:31 | Re: nextval/dbi question |