Re: pl/pgsql switch

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Luis Silva <lfs12(at)hotmail(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: pl/pgsql switch
Date: 2006-01-24 20:51:38
Message-ID: 20060124205138.GA91099@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On Tue, Jan 24, 2006 at 05:51:37PM +0000, Luis Silva wrote:
> I there, do we have switch(){ case:} in pl/pgsql. Tks

See the PL/pgSQL documentation, in particular the "Control Structures"
section. Here's the link for 8.1 (but use the documentation for
whatever version you're running):

http://www.postgresql.org/docs/8.1/interactive/plpgsql-control-structures.html

The documentation shows no switch/case structure but you should be
able to do the same thing with IF-THEN-ELSIF. However, SQL does
have a CASE expression that you might be able to use:

http://www.postgresql.org/docs/8.1/interactive/functions-conditional.html

--
Michael Fuhr

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Michael Fuhr 2006-01-24 21:50:06 Re: default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP
Previous Message Luis Silva 2006-01-24 17:51:37 pl/pgsql switch