Re: pl/pgsql or control structures outside of a function?

From: Peter Koczan <pjkoczan(at)gmail(dot)com>
To: John DeSoi <desoi(at)pgedit(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: pl/pgsql or control structures outside of a function?
Date: 2009-04-06 16:42:29
Message-ID: 4544e0330904060942x379fac35n63b1ebf6d661f26a@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Fri, Apr 3, 2009 at 11:28 PM, John DeSoi <desoi(at)pgedit(dot)com> wrote:
>> Is there any way to use PL/pgSQL code outside of a function?
>
> No.

I kinda figured, but it doesn't hurt to ask.

>> The reason I'm asking is that I'm porting some code from
>> sybase/isql/SQR, and it allows some control code structures to be used
>> in an sql script. For instance,
>
> CASE might work for you.
>
> http://www.postgresql.org/docs/8.3/interactive/functions-conditional.html

Thanks for the suggestion. I think that for what I'm trying to do,
adding a bunch of case statements would very quickly become
unmaintainable. Wrapper scripts are probably the way to go for me.

Thanks again,
Peter

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Glenn Maynard 2009-04-08 02:34:38 Nested selects
Previous Message Greg Sabino Mullane 2009-04-06 14:29:28 Re: Performance problem with row count trigger