Re: PL/pgSQL trigger and sequence increment

Поиск
Список
Период
Сортировка
От jonesd@xmission.com
Тема Re: PL/pgSQL trigger and sequence increment
Дата
Msg-id 20110907103209.pysjcfey4oos48sg@webmail.xmission.com
обсуждение исходный текст
Ответ на PL/pgSQL trigger and sequence increment  (jonesd@xmission.com)
Ответы Re: PL/pgSQL trigger and sequence increment
Список pgsql-general
> Seems like you would be a lot better off enforcing this with a unique
> index on (submitter_id, date_trunc('month',entry_timestamp)).  The above
> not only doesn't provide any feedback, it's got serious race-condition
> problems.

Unfortunately, it didn't work.

CREATE UNIQUE INDEX one_entry_per_submitter_per_month ON table_entry
(submitter_id , date_trunc('month',entry_timestamp));

runs into

ERROR:  functions in index expression must be marked IMMUTABLE.

If I'm reading this correctly, date_trunc is not IMMUTABLE and thus
not usable in an index.


Dominic Jones, Ph.D.

В списке pgsql-general по дате отправления:

Предыдущее
От: Radosław Smogura
Дата:
Сообщение: Re: SSL certificates issue
Следующее
От: Andrew Sullivan
Дата:
Сообщение: Re: SSL certificates issue