Re: easy way to insert same value into 2 columns

From: Shridhar Daithankar <shridhar_daithankar(at)persistent(dot)co(dot)in>
To: Postgres general mailing list <pgsql-general(at)postgresql(dot)org>
Subject: Re: easy way to insert same value into 2 columns
Date: 2003-10-16 10:50:08
Message-ID: 3F8E77E0.7080701@persistent.co.in
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Richard Huxton 2003-10-16 10:51:19 Re: easy way to insert same value into 2 columns
Previous Message Sebastian Boeck 2003-10-16 10:11:51 Re: easy way to insert same value into 2 columns