Re: easy way to insert same value into 2 columns

Поиск
Список
Период
Сортировка
Искать
От
Shridhar Daithankar
Тема
Re: easy way to insert same value into 2 columns
Дата
Msg-id
3F8E77E0.7080701@persistent.co.in
Ответ на
Список
Дерево обсуждения
easy way to insert same value into 2 columns Sebastian Boeck <sebastianboeck@freenet.de>
Re: easy way to insert same value into 2 columns Csaba Nagy <nagy@ecircle-ag.com>
Re: easy way to insert same value into 2 columns Sebastian Boeck <sebastianboeck@freenet.de>
Re: easy way to insert same value into 2 columns Jacob Vennervald <jvennervald@proventum.net>
Re: easy way to insert same value into 2 columns Sebastian Boeck <sebastianboeck@freenet.de>
Re: easy way to insert same value into 2 columns Csaba Nagy <nagy@ecircle-ag.com>
Re: easy way to insert same value into 2 columns Sebastian Boeck <sebastianboeck@freenet.de>
Re: easy way to insert same value into 2 columns Bruno Wolff III <bruno@wolff.to>
Re: easy way to insert same value into 2 columns Richard Huxton <dev@archonet.com>
Re: easy way to insert same value into 2 columns Sebastian Boeck <sebastianboeck@freenet.de>
Re: easy way to insert same value into 2 columns Shridhar Daithankar <shridhar_daithankar@persistent.co.in>
Re: easy way to insert same value into 2 columns Shridhar Daithankar <shridhar_daithankar@persistent.co.in>
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 по дате отправления
От: Sebastian Boeck
Дата:
От: Richard Huxton
Дата:
FAQ