Re: shorter way to get new value of serial?

From: Harald Armin Massa <haraldarminmassa(at)gmail(dot)com>
To: Alban Hertroys <alban(at)magproductions(dot)nl>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: shorter way to get new value of serial?
Date: 2005-11-21 10:13:04
Message-ID: 7be3f35d0511210213h7e147acav@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Hannes Dorbath 2005-11-21 11:16:41 TSearch2 Questions
Previous Message Alban Hertroys 2005-11-21 10:08:18 Re: shorter way to get new value of serial?