Re: shorter way to get new value of serial? - Mailing list pgsql-general

From Harald Armin Massa
Subject Re: shorter way to get new value of serial?
Date
Msg-id 7be3f35d0511210213h7e147acav@mail.gmail.com
Whole thread Raw
In response to Re: shorter way to get new value of serial?  (Alban Hertroys <alban@magproductions.nl>)
List pgsql-general
Alban Hertroys,

Why don't you just use the default? You could entirely do away with the
'result' variable that way:

because I need to know which is the new id of that computer. The other way would be "insert if not exists" and again "select where name = ..." -> 1 statement more, and without a stored procedure even a roundtrip client - server - client more, which is expensive in WAN situations :(

Harald


--
GHUM Harald Massa
persuasion python postgresql
Harald Armin Massa
Reinsburgstraße 202b
70197 Stuttgart
0173/9409607

pgsql-general by date:

Previous
From: Alban Hertroys
Date:
Subject: Re: shorter way to get new value of serial?
Next
From: Hannes Dorbath
Date:
Subject: TSearch2 Questions