Re: lastval()

From: "John Hansen" <john(at)geeknet(dot)com(dot)au>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Neil Conway" <neilc(at)samurai(dot)com>, "Dennis Bjorklund" <db(at)zigo(dot)dhs(dot)org>, <pgsql-patches(at)postgresql(dot)org>
Subject: Re: lastval()
Date: 2005-05-11 07:03:53
Message-ID: 5066E5A966339E42AA04BA10BA706AE50A931F@rodrick.geeknet.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Tom Lane wrote:
> Sent: Wednesday, May 11, 2005 3:41 PM
> To: John Hansen
> Cc: Neil Conway; Dennis Bjorklund; pgsql-patches(at)postgresql(dot)org
> Subject: Re: [PATCHES] lastval()
>
> "John Hansen" <john(at)geeknet(dot)com(dot)au> writes:
> > I'm all for it. Even more so if the 'currval(void) called before
> > nextval(seq_name)' error message could be supressed by a
> GUC variable
> > and return 0 instead.
>
> I really have a hard time seeing the argument why that
> condition does not mean "your application is broken and you
> should fix it".

I'm _not_ saying that, I'm saying that the ports that would be a breeze
with this behaviour, probably won't happen without. Which is a shame.
Also note that I'm not suggesting this be the default behaviour. I'm not
even suggesting it be a configurable permanent (in fact it probably
shouldn't be configurable thru postgresql.conf), but merely a SET
parameter, that you can set prior to executing lastval(), or perhaps as
lastval(false/true);

> Much less why "0" is the correct response --- it's barely
> conceivable that you could persuade me that NULL is ok, but
> never a value that is a valid sequence value.

NULL would do fine.

> regards, tom lane
>
>

... John

Browse pgsql-patches by date

  From Date Subject
Next Message Mahmoud Taghizadeh 2005-05-11 08:07:07 Where is Translation of "FARSI" FAQ?
Previous Message Tom Lane 2005-05-11 05:41:09 Re: lastval()