Re: multiple conflict targets

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: Torsten Förtsch <tfoertsch123(at)gmail(dot)com>, pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: multiple conflict targets
Date: 2018-08-10 13:28:30
Message-ID: 5894f679-804e-379d-cc49-03936f54af9e@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 08/10/2018 03:12 AM, Torsten Förtsch wrote:
> Hi,
>
> if I read https://www.postgresql.org/docs/9.6/static/sql-insert.html
> correctly there can be only one conflict target or none at all.
>
> What if I have a table with 3 unique constraints? If the first one is
> violated by the insert I want to do nothing. If the 2nd is violated some
> fields should be updated. And violation of the 3rd one should raise an
> error.
>
> Can that be expressed?

Yes as a trigger and associated function.

>
> Thanks,
> Torsten

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message dangal 2018-08-10 14:01:53 Audit management
Previous Message Saccilotto Ramon 2018-08-10 12:34:32 Re: Ltree - how to sort nodes on parent node