Executing dynamic queries without functions / procedures

From: Nicholas Bott <zordiac(at)zordiac(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Executing dynamic queries without functions / procedures
Date: 2007-05-11 23:45:29
Message-ID: 46450019.6090005@zordiac.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Is it possible to execute a dynamic query similarly to MS SQL, like so:
IF EXISTS(SELECT * FROM Table WHERE Condition)
DO SOMETHING

I would like to use the PL language in conjunction with conditional
statements, outside of a procedure or function. This doesn't seem to be
possible from what I've read so far and I wanted to confirm.

Also, if it's not natively possible - is there some kind of hack? For
example, creating temporary procedures to establish the same result,
then removing them periodically?

Thanks much.
--
Nicholas Bott

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Tom Lane 2007-05-12 03:58:38 Re: Executing dynamic queries without functions / procedures
Previous Message Tom Lane 2007-05-11 02:19:46 Re: noob trying to use PG with Zope