pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: John Lumby <johnlumby@hotmail.com>
Cc: Adrian Klaver <adrian.klaver@aklaver.com>
Cc: pgsql general <pgsql-general@postgresql.org>
Subject: Re: access to original-statement predicates in an INSTEAD-OF row trigger
Date: Sat, 16 Nov 2019 10:37:13 -0500
Message-ID: <29541.1573918633@sss.pgh.pa.us> (raw)
In-Reply-To: <DM6PR06MB55625FC99325B3A33EE2EC8CA3730@DM6PR06MB5562.namprd06.prod.outlook.com>
References: <DM6PR06MB55626255D26D1F4ABFB36B0EA3700@DM6PR06MB5562.namprd06.prod.outlook.com>
	<f7529e3b-330f-9d8d-6f2d-d36582e54150@aklaver.com>
	<DM6PR06MB5562745164BAFB15D805993EA3700@DM6PR06MB5562.namprd06.prod.outlook.com>
	<8abf71b6-26b0-3d7e-f02c-9c33f323d792@aklaver.com>
	<DM6PR06MB55629A7224717C7237CEB011A3700@DM6PR06MB5562.namprd06.prod.outlook.com>
	<DM6PR06MB5562FB8507E487AD13F2D655A3700@DM6PR06MB5562.namprd06.prod.outlook.com>
	<6ea3b732-1f37-41c9-29a1-65f3aaebb6cd@aklaver.com>
	<DM6PR06MB55625FC99325B3A33EE2EC8CA3730@DM6PR06MB5562.namprd06.prod.outlook.com>

John Lumby <johnlumby@hotmail.com> writes:
> How can a row trigger access the original SQL statement at the root of 
> the current operation?

It can't; at least not in any way that'd be reliable or maintainable.

I concur with the upthread recommendation that switching to serializable
mode would be a more manageable way of dealing with concurrent-update
problems.

			regards, tom lane





view thread (8+ messages)

Message-ID: <29541.1573918633@sss.pgh.pa.us>
Permalink:  ../29541.1573918633@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/29541.1573918633@sss.pgh.pa.us

 · 

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: tgl@sss.pgh.pa.us, johnlumby@hotmail.com, adrian.klaver@aklaver.com
  Subject: Re: access to original-statement predicates in an INSTEAD-OF row trigger
  In-Reply-To: <29541.1573918633@sss.pgh.pa.us>
  References: <DM6PR06MB55626255D26D1F4ABFB36B0EA3700@DM6PR06MB5562.namprd06.prod.outlook.com> <f7529e3b-330f-9d8d-6f2d-d36582e54150@aklaver.com> <DM6PR06MB5562745164BAFB15D805993EA3700@DM6PR06MB5562.namprd06.prod.outlook.com> <8abf71b6-26b0-3d7e-f02c-9c33f323d792@aklaver.com> <DM6PR06MB55629A7224717C7237CEB011A3700@DM6PR06MB5562.namprd06.prod.outlook.com> <DM6PR06MB5562FB8507E487AD13F2D655A3700@DM6PR06MB5562.namprd06.prod.outlook.com> <6ea3b732-1f37-41c9-29a1-65f3aaebb6cd@aklaver.com> <DM6PR06MB55625FC99325B3A33EE2EC8CA3730@DM6PR06MB5562.namprd06.prod.outlook.com> <29541.1573918633@sss.pgh.pa.us>

* 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