Search Postgresql Archives

Re: functions, transactions, key violations

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Michael Glaesemann <grzm@xxxxxxxxxxxxxxx> 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


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux