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
обсуждение исходный текст
Ответ на Re: easy way to insert same value into 2 columns  (Sebastian Boeck <sebastianboeck@freenet.de>)
Список 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 по дате отправления:

Предыдущее
От: Sebastian Boeck
Дата:
Сообщение: Re: easy way to insert same value into 2 columns
Следующее
От: Richard Huxton
Дата:
Сообщение: Re: easy way to insert same value into 2 columns