Re: How to make the row changes inside trigger function visible to the top level sql statement?

From: Haifeng Liu <liuhaifeng(at)live(dot)com>
To: Sergey Konoplev <sergey(dot)konoplev(at)postgresql-consulting(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: How to make the row changes inside trigger function visible to the top level sql statement?
Date: 2012-08-09 12:32:03
Message-ID: BLU0-SMTP279DBCEEDD4356D2F02A06DB9CC0@phx.gbl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin


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

> On Thu, Aug 9, 2012 at 2:53 PM, Sergey Konoplev
> <sergey(dot)konoplev(at)postgresql-consulting(dot)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(dot)ru(at)gmail(dot)com Skype: gray-hemp Phone: +79160686204
>
>
>
> --
> Sergey Konoplev
>
> a database architect, software developer at PostgreSQL-Consulting.com
> http://www.postgresql-consulting.com
>
> Jabber: gray(dot)ru(at)gmail(dot)com Skype: gray-hemp Phone: +79160686204
>
> --
> Sent via pgsql-admin mailing list (pgsql-admin(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-admin
>

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Craig Ringer 2012-08-09 12:49:51 Re: Data migration to sql server 2008
Previous Message Sergey Konoplev 2012-08-09 11:11:45 Re: How to make the row changes inside trigger function visible to the top level sql statement?