[GENERAL] Multiply ON CONFLICT ON CONSTRAINT - Mailing list pgsql-general

From Arnold Somogyi
Subject [GENERAL] Multiply ON CONFLICT ON CONSTRAINT
Date
Msg-id CA+gPAuQjPuAH8YgAO7fDv55cZzJMMfWr8uRQ-xgvQ3Pw14Ai4w@mail.gmail.com
Whole thread Raw
Responses Re: [GENERAL] Multiply ON CONFLICT ON CONSTRAINT  (Adrian Klaver <adrian.klaver@aklaver.com>)
List pgsql-general
Hi,

I wonder if there is a way to add more then one ON CONSTRAINT value.
I have many different unique constraints on my table and I would like to catch and handle two of them with ON CONFLICT ON CONSTRAINT. And the rest errors will be handled by the client application.

INSERT INTO table_1 (id, name, value, user_id, description)
VALUES (1, 'name', 'value', null, null)
ON CONFLICT ON CONSTRAINT table1_pkey, table1_name_key DO UPDATE
SET value = EXCLUDED.value, user_id = EXCLUDED.user_id, description = EXCLUDED.description

Regards,
Arnold

pgsql-general by date:

Previous
From: Jeff Janes
Date:
Subject: Re: [GENERAL] disk writes within a transaction
Next
From: Richard Brosnahan
Date:
Subject: Re: [GENERAL] PostgreSQL mirroring from RPM install to RPMinstall-revisited