From: Peter Koczan <pjkoczan@gmail.com>
To: John DeSoi <desoi@pgedit.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: pl/pgsql or control structures outside of a function?
Date: Mon, 6 Apr 2009 11:42:29 -0500
Message-ID: <4544e0330904060942x379fac35n63b1ebf6d661f26a@mail.gmail.com> (raw)
In-Reply-To: <29505E7D-05C7-4F8A-91AD-C5596FA51987@pgedit.com>
References: <4544e0330904031403i218fdb3cxf18d8971ff284290@mail.gmail.com>
<29505E7D-05C7-4F8A-91AD-C5596FA51987@pgedit.com>
On Fri, Apr 3, 2009 at 11:28 PM, John DeSoi <desoi@pgedit.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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: pjkoczan@gmail.com, desoi@pgedit.com
Subject: Re: pl/pgsql or control structures outside of a function?
In-Reply-To: <4544e0330904060942x379fac35n63b1ebf6d661f26a@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox