On Thu, Oct 16, 2003 at 13:53:27 +0200,
Sebastian Boeck <sebastianboeck@freenet.de> wrote:
> Csaba Nagy wrote:
> >I can't 100% say it's safe to use, but no, other inserts will not
> >influence the value, because currval will return the last sequence value
> >used by the current session (i.e. the current connection). And of course
> >you only have concurrent inserts using different connection, right ?
> >
> >HTH,
> >Csaba.
>
> Yes, that' right.
>
> Thanks
As mentioned earlier, the problem is with concurrent inserts, but rather
with which default expression gets calculated first. Today you are likely
to get predictable behavior out of this, but if you do an alter table
or perhaps upgrade to a new version of postgres, your code may break.