Re: easy way to insert same value into 2 columns - Mailing list pgsql-general

From Bruno Wolff III
Subject Re: easy way to insert same value into 2 columns
Date
Msg-id 20031016172050.GD28009@wolff.to
Whole thread Raw
In response to Re: easy way to insert same value into 2 columns  (Sebastian Boeck <sebastianboeck@freenet.de>)
List pgsql-general
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.

pgsql-general by date:

Previous
From: "Matthew T. O'Connor"
Date:
Subject: Re: VACUUM degrades performance significantly. Database
Next
From: Joseph Shraibman
Date:
Subject: Re: ShmemAlloc errors