pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Haifeng Liu <liuhaifeng@live.com>
To: Sergey Konoplev <sergey.konoplev@postgresql-consulting.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: How to make the row changes inside trigger function visible to the top level sql statement?
Date: Thu, 9 Aug 2012 20:32:03 +0800
Message-ID: <BLU0-SMTP279DBCEEDD4356D2F02A06DB9CC0@phx.gbl> (raw)
In-Reply-To: <CAL_0b1tSaJ0cp+oHsEnCP7qDemcHuNM-hUXpaBzrrrs5XTHyRQ@mail.gmail.com>
References: <571AFDFA-85FB-4EF4-B811-F7722DE28F10@gmail.com>
	<CAL_0b1sbSV_4EEimLx2oVCSrsE7M5geQ3AJw6SOX5t+xEyidRg@mail.gmail.com>
	<CAL_0b1tSaJ0cp+oHsEnCP7qDemcHuNM-hUXpaBzrrrs5XTHyRQ@mail.gmail.com>


On Aug 9, 2012, at 7:11 PM, Sergey Konoplev <sergey.konoplev@postgresql-consulting.com> wrote:

> On Thu, Aug 9, 2012 at 2:53 PM, Sergey Konoplev
> <sergey.konoplev@postgresql-consulting.com> wrote:
>>> How can I make the row changes inside the trigger function visible to the top level statement?
>> 
>> your redirecting function is okay. However the only way to get the
>> inserted row back is to do it from a subsequent statement in the
>> partitioning case.
> 
> BTW I am not completely correct here. There is a solution but it is a
> tricky one https://gist.github.com/59067. I am not sure if it is a
> good performing one but it will work.

I don't think it's a good solution for a partitioned table. Any how, thank you for the information.

> 
>> In your application you can use LISTEN/NOTIFY if you need to get some
>> specific information from trigger BTW. May be it will help somehow.
>> 
>> --
>> Sergey Konoplev
>> 
>> a database architect, software developer at PostgreSQL-Consulting.com
>> http://www.postgresql-consulting.com
>> 
>> Jabber: gray.ru@gmail.com Skype: gray-hemp Phone: +79160686204
> 
> 
> 
> -- 
> Sergey Konoplev
> 
> a database architect, software developer at PostgreSQL-Consulting.com
> http://www.postgresql-consulting.com
> 
> Jabber: gray.ru@gmail.com Skype: gray-hemp Phone: +79160686204
> 
> -- 
> Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-admin
> 




view thread (4+ messages)

Message-ID: <BLU0-SMTP279DBCEEDD4356D2F02A06DB9CC0@phx.gbl>
Permalink:  ../BLU0-SMTP279DBCEEDD4356D2F02A06DB9CC0@phx.gbl/
Also on:    postgresql.org/message-id/BLU0-SMTP279DBCEEDD4356D2F02A06DB9CC0@phx.gbl

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: liuhaifeng@live.com, sergey.konoplev@postgresql-consulting.com
  Subject: Re: How to make the row changes inside trigger function visible to the top level sql statement?
  In-Reply-To: <BLU0-SMTP279DBCEEDD4356D2F02A06DB9CC0@phx.gbl>

* 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