Re: lastval() - Mailing list pgsql-patches

From Tom Lane
Subject Re: lastval()
Date
Msg-id 17146.1118031644@sss.pgh.pa.us
Whole thread Raw
In response to Re: lastval()  (Neil Conway <neilc@samurai.com>)
Responses Re: lastval()
List pgsql-patches
Neil Conway <neilc@samurai.com> writes:
> Abhijit Menon-Sen wrote:
>> I'd really like to see a concise, complete description of the proposed
>> function, including potential caveats.

> lastval() returns the last value produced by nextval() or setval() in
> the current session.

This definition is OK with me ... so long as it still includes the
phrase "an error occurs if no nextval or setval has occurred in the
current session".  However it seemed that a number of people asking
for the feature wanted some-random-default to be returned instead.

Another question is why should setval affect the result?  I don't
see the use-case for that offhand.

            regards, tom lane

pgsql-patches by date:

Previous
From: Neil Conway
Date:
Subject: Re: lastval()
Next
From: Neil Conway
Date:
Subject: Re: lastval()