Re: functions, transactions, key violations

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: functions, transactions, key violations
Дата
Msg-id 5957.1212615578@sss.pgh.pa.us
обсуждение исходный текст
Ответ на functions, transactions, key violations  (Michael Glaesemann <grzm@seespotcode.net>)
Ответы Re: functions, transactions, key violations
Список pgsql-general
Michael Glaesemann <grzm@seespotcode.net> writes:
> We have a function which has been throwing a key violation. We're
> tracking the purchase history for a limited number of unique items,
> and flagging the most recent purchase with purchase_status = 1.

Um, the function is ensuring that there is no conflicting row with
the same item_id, but the unique constraint is on purchase_id.
Plus, since purchase_id is declared PRIMARY KEY, the additional
unique constraint is surely a no-op.

I think you've anonymized the example into nonsense :-(.

            regards, tom lane

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

Предыдущее
От: Ralph Smith
Дата:
Сообщение: Script errors on run
Следующее
От: Michael Glaesemann
Дата:
Сообщение: Re: functions, transactions, key violations