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

From Shridhar Daithankar
Subject Re: easy way to insert same value into 2 columns
Date
Msg-id 3F8E77E0.7080701@persistent.co.in
Whole thread Raw
In response to Re: easy way to insert same value into 2 columns  (Sebastian Boeck <sebastianboeck@freenet.de>)
List pgsql-general
Sebastian Boeck wrote:
> Thanks a lot, but is it save to use?
>
> Do i always get the same value, even if an other insert is changing the
> sequence >public.zeit_id_seq< just at the same time?

You can write a before insert trigger where you retrieve sequence value once and
set for two fields. That way it will ensure that both the fields would get same
value.

  HTH

  Shridhar


pgsql-general by date:

Previous
From: Sebastian Boeck
Date:
Subject: Re: easy way to insert same value into 2 columns
Next
From: Richard Huxton
Date:
Subject: Re: easy way to insert same value into 2 columns