trigger - dynamic WHERE clause

From: Tarlika Elisabeth Schmitz <postgresql3(at)numerixtechnology(dot)de>
To: pgsql-general(at)postgresql(dot)org
Subject: trigger - dynamic WHERE clause
Date: 2011-05-22 17:18:21
Message-ID: 20110522181821.593c60c8@dick.coachhouse
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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?

--

Best Regards,
Tarlika Elisabeth Schmitz

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Darren Duncan 2011-05-22 17:45:46 Re: how to start a procedure after postgresql started.
Previous Message Scott Marlowe 2011-05-22 15:13:19 Re: how to start a procedure after postgresql started.