Re: Use ctid in where clause in update from statement

From: Thomas Kellerer <spam_eater(at)gmx(dot)net>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Use ctid in where clause in update from statement
Date: 2019-07-01 11:33:06
Message-ID: 1c9e7d1d-ea2e-8f48-7a05-268254a9aad5@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Dirk Mika schrieb am 01.07.2019 um 13:18:
> The problem with the INSERT ON CONFLICT is that an insert is tried here first, which may fire triggers.
>
> In my case there is a fairly expensive INSERT Trigger ON EACH ROW, which I would like to avoid.

The insert trigger will only be fired if an INSERT actually takes place.

If INSERT ON CONFLICT results in an UPDATE (or a DO NOTHING), no INSERT trigger will be fired.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Dirk Mika 2019-07-01 11:40:19 Re: Use ctid in where clause in update from statement
Previous Message Thomas Kellerer 2019-07-01 11:25:22 Re: Use ctid in where clause in update from statement