Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id 82BF11E4A567 for ; Thu, 9 Aug 2012 09:33:00 -0300 (ADT) Received: from blu0-omc1-s28.blu0.hotmail.com ([65.55.116.39]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1SzRv5-0002wt-Ig for pgsql-admin@postgresql.org; Thu, 09 Aug 2012 12:33:00 +0000 Received: from BLU0-SMTP279 ([65.55.116.7]) by blu0-omc1-s28.blu0.hotmail.com with Microsoft SMTPSVC(6.0.3790.4675); Thu, 9 Aug 2012 05:32:41 -0700 X-Originating-IP: [101.68.89.3] X-EIP: [/wDco16G8yHC3SVgSeudSachKOM/dUF6] X-Originating-Email: [liuhaifeng@live.com] Message-ID: Received: from [192.168.1.6] ([101.68.89.3]) by BLU0-SMTP279.blu0.hotmail.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Thu, 9 Aug 2012 05:32:40 -0700 Content-Type: text/plain; charset="iso-8859-1" MIME-Version: 1.0 (Mac OS X Mail 6.0 \(1485\)) Subject: Re: How to make the row changes inside trigger function visible to the top level sql statement? From: Haifeng Liu In-Reply-To: Date: Thu, 9 Aug 2012 20:32:03 +0800 CC: pgsql-admin@postgresql.org Content-Transfer-Encoding: quoted-printable References: <571AFDFA-85FB-4EF4-B811-F7722DE28F10@gmail.com> To: Sergey Konoplev X-Mailer: Apple Mail (2.1485) X-OriginalArrivalTime: 09 Aug 2012 12:32:41.0208 (UTC) FILETIME=[1173B780:01CD762B] X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201208/62 X-Sequence-Number: 39883 On Aug 9, 2012, at 7:11 PM, Sergey Konoplev wrote: > On Thu, Aug 9, 2012 at 2:53 PM, Sergey Konoplev > wrote: >>> How can I make the row changes inside the trigger function visible to t= he top level statement? >>=20 >> 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. >=20 > 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. >=20 >> 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. >>=20 >> -- >> Sergey Konoplev >>=20 >> a database architect, software developer at PostgreSQL-Consulting.com >> http://www.postgresql-consulting.com >>=20 >> Jabber: gray.ru@gmail.com Skype: gray-hemp Phone: +79160686204 >=20 >=20 >=20 > --=20 > Sergey Konoplev >=20 > a database architect, software developer at PostgreSQL-Consulting.com > http://www.postgresql-consulting.com >=20 > Jabber: gray.ru@gmail.com Skype: gray-hemp Phone: +79160686204 >=20 > --=20 > Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-admin >=20