Re: Emulating trigger BEFORE SELECT behavior

From: Adrian Klaver <adrian(dot)klaver(at)gmail(dot)com>
To: Atri Sharma <atri(dot)jiit(at)gmail(dot)com>
Cc: Alfonso Afonso <aafonsoc(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Emulating trigger BEFORE SELECT behavior
Date: 2013-04-18 13:21:21
Message-ID: 516FF351.4070408@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 04/18/2013 05:12 AM, Atri Sharma wrote:
> On Thu, Apr 18, 2013 at 5:35 PM, Alfonso Afonso <aafonsoc(at)gmail(dot)com> wrote:
>> Hi Atri
>>
>> Maybe you could think different and, instead of do a "before select trigger", you can:
>>
>> - create a store procedure with result is a recordset
>> - create a view
>>
>> If you can't... could you please explain us a bit more about the requirements about this before action?
>>
>> Good luck
>
> Hi Alonso,
>
> Sure, I will try that out.
>
> The before operation shall get the values of all the columns of the
> queried table, convert them to a string and insert the string into a
> different table.Then, the SELECT query shall proceed as before.

How about a RULE:

http://www.postgresql.org/docs/9.2/interactive/sql-createrule.html

Rules can be tricky, so I would at least skim through:

http://www.postgresql.org/docs/9.2/interactive/rules.html

>
> Regards,
>
> Atri
>
> --
> Regards,
>
> Atri
> l'apprenant
>
>

--
Adrian Klaver
adrian(dot)klaver(at)gmail(dot)com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message ascot.moss@gmail.com 2013-04-18 13:40:04 Re: How to build my own 9.2.4 installer package for IBM Power System ppc64
Previous Message Atri Sharma 2013-04-18 12:12:41 Re: Emulating trigger BEFORE SELECT behavior