Re: execute if statement - Mailing list pgsql-general

From Raymond O'Donnell
Subject Re: execute if statement
Date
Msg-id 50BA62EB.3020002@iol.ie
Whole thread Raw
In response to Re: execute if statement  (Peter Kroon <plakroon@gmail.com>)
List pgsql-general
On 01/12/2012 19:44, Peter Kroon wrote:
> Mmmmm.......
>
> How do I execute dynamic sql that starts with an if statement.
> I'm converting mssql code to pgsql.
>

Without trying it, I'd guess that you need to have the IF outside the
dynamic code, something like this:

  if .... then
    execute '.....';
  end if;

If you show what you're trying to achieve, someone might be able to
suggest something better.

Ray.

--
Raymond O'Donnell :: Galway :: Ireland
rod@iol.ie


pgsql-general by date:

Previous
From: Peter Kroon
Date:
Subject: Re: execute if statement
Next
From: Edson Richter
Date:
Subject: Re: Revoke "drop database" even for superusers?