pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Thomas Kellerer <spam_eater@gmx.net>
To: pgsql-general@lists.postgresql.org
Subject: Re: Use ctid in where clause in update from statement
Date: Mon, 1 Jul 2019 13:33:06 +0200
Message-ID: <1c9e7d1d-ea2e-8f48-7a05-268254a9aad5@gmx.net> (raw)
In-Reply-To: <428A47B1-DBC5-47D6-B361-C142B2534756@mikatiming.de>
References: <C8D480EC-AFF2-40CC-8BD3-754A1204011A@mikatiming.de>
	<73fbdc2d-36cc-a96a-5019-f7c78876ed8d@matrix.gatewaynet.com>
	<428A47B1-DBC5-47D6-B361-C142B2534756@mikatiming.de>

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.






view thread (14+ messages)  latest in thread

Message-ID: <1c9e7d1d-ea2e-8f48-7a05-268254a9aad5@gmx.net>
Permalink:  ../1c9e7d1d-ea2e-8f48-7a05-268254a9aad5@gmx.net/
Also on:    postgresql.org/message-id/1c9e7d1d-ea2e-8f48-7a05-268254a9aad5@gmx.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: spam_eater@gmx.net
  Subject: Re: Use ctid in where clause in update from statement
  In-Reply-To: <1c9e7d1d-ea2e-8f48-7a05-268254a9aad5@gmx.net>
  References: <C8D480EC-AFF2-40CC-8BD3-754A1204011A@mikatiming.de> <73fbdc2d-36cc-a96a-5019-f7c78876ed8d@matrix.gatewaynet.com> <428A47B1-DBC5-47D6-B361-C142B2534756@mikatiming.de> <1c9e7d1d-ea2e-8f48-7a05-268254a9aad5@gmx.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox