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

From Pavel Stehule
Subject Re: trigger - dynamic WHERE clause
Date
Msg-id BANLkTi=duDhBAkHNXH4=zH0MQgvcTnN4iA@mail.gmail.com
Whole thread Raw
In response to trigger - dynamic WHERE clause  (Tarlika Elisabeth Schmitz <postgresql3@numerixtechnology.de>)
Responses Re: trigger - dynamic WHERE clause
List pgsql-general
Hello

2011/5/22 Tarlika Elisabeth Schmitz <postgresql3@numerixtechnology.de>:
> EXECUTE 'SELECT 1 FROM ' || TG_TABLE_NAME || ' WHERE ' || whereclause
> || ' FOR UPDATE;';
>
> I am generating the whereclause dynamically as the number of columns
> queried varies.
>
> Am I right in assuming that I cannot use EXECUTE ... USING in this
> scenario?
>

why not? You can use it - just USING has a fixed numbers of
parameters, so you should to use a arrays.

Regards

Pavel Stehule

> --
>
> 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: John R Pierce
Date:
Subject: Re: Unable to Install - "unable to write inside TEMP environment variable path"
Next
From: jun yang
Date:
Subject: Re: how to start a procedure after postgresql started.