Re: trigger - dynamic WHERE clause - Mailing list pgsql-general

From Pavel Stehule
Subject Re: trigger - dynamic WHERE clause
Date
Msg-id BANLkTim5R_FVHvm9EEZ9NcRMqgCzXsD3wg@mail.gmail.com
Whole thread Raw
In response to Re: trigger - dynamic WHERE clause  (Tarlika Elisabeth Schmitz <postgresql3@numerixtechnology.de>)
Responses Re: trigger - dynamic WHERE clause  (Tarlika Elisabeth Schmitz <postgresql3@numerixtechnology.de>)
List pgsql-general
2011/5/31 Tarlika Elisabeth Schmitz <postgresql3@numerixtechnology.de>:
> On Mon, 30 May 2011 11:02:34 +0200
> Pavel Stehule <pavel.stehule@gmail.com> wrote:
>
>>> 2) I took from your blog entry
>>> (http://okbob.blogspot.com/2008/06/execute-using-feature-in-postgresql-84.html)
>>> that it is good practice to use EXECUTE USING.
>>> Well, there's no danger of SQL injection as this particular DB runs
>>> on an internal network. However, I am wondering whether EXECUTE
>>> USING has a performance advantage?
>>>
>>
>>You newer know where or who is attacker :)
>>The performance is very similar now - the most slow part is generating
>>of execution plan - not IO operations.
>
> I have converted my generic trigger to use EXECUTE ... USING.
>
> I need to convert all NEW values to a text array, retaining their
> ordinal position.
> avals(hstore(NEW)) doesn't seem to do that:
>
> NEW: (5,name5,1000,,,2)
> avals(hstore(NEW)):  {5,name5,2,1000,NULL,NULL}
>
> The best I can come up with is a JOIN with information_schema.columns.

jup

it should be relative expensive (slow). If you need a generic triggers
use different PL instead. I can not to know what requests you have to
solve. But try to look on PLPerl or PLPython. Generic triggers can be
developed there with less work.

Regards

Pavel

>
> --
>
> Best Regards,
> Tarlika Elisabeth Schmitz
>
> --
> Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>

pgsql-general by date:

Previous
From: Nick Raj
Date:
Subject: Re: Index Size
Next
From: Craig Ringer
Date:
Subject: Re: Index Size