Re: calling currval() before nextval() patch adding currval_isset() - Mailing list pgsql-patches

From Tom Lane
Subject Re: calling currval() before nextval() patch adding currval_isset()
Date
Msg-id 24899.1099871288@sss.pgh.pa.us
Whole thread Raw
In response to calling currval() before nextval() patch adding currval_isset()  (John Hansen <john@geeknet.com.au>)
Responses Re: calling currval() before nextval() patch adding  (John Hansen <john@geeknet.com.au>)
List pgsql-patches
John Hansen <john@geeknet.com.au> writes:
> attached, cvs context diff that adds currval_isset('sequence_name');

> This avoids the warning messages you get when calling currval before
> nextval in situations where the program flow does not allow you to
> predetermine if the current session has called nexval yet.

I would argue that a program written that way is broken by definition,
and we should not encourage programmers to write broken applications.

            regards, tom lane

pgsql-patches by date:

Previous
From: Rod Taylor
Date:
Subject: Re: calling currval() before nextval() patch adding
Next
From: John Hansen
Date:
Subject: Re: calling currval() before nextval() patch adding