Re: spi/timetravel: unique constraint violation on UPDATE

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: postgresql(at)get-experience(dot)com
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: spi/timetravel: unique constraint violation on UPDATE
Date: 2017-07-15 22:03:13
Message-ID: 30827.1500156193@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

postgresql(at)get-experience(dot)com writes:
> Den 15. juli 2017 23:15, skrev Tom Lane:
>> Perhaps you could make your PK be on (id, valid_from, valid_to).

> Doesn't really work because valid_to would change on UPDATE. I'd need to
> update foreign relations with another trigger which would be very ugly.

Um ... wouldn't ON UPDATE CASCADE help?

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Karsten Hilbert 2017-07-16 10:08:43 Re: How to drop column from interrelated views
Previous Message postgresql 2017-07-15 21:36:27 Re: spi/timetravel: unique constraint violation on UPDATE