Re: case statement as inline function? - Mailing list pgsql-general

From Mike Nolan
Subject Re: case statement as inline function?
Date
Msg-id 200403241852.i2OIqYcm001471@gw.tssi.com
Whole thread Raw
In response to Re: case statement as inline function?  (Richard Huxton <dev@archonet.com>)
List pgsql-general
> > Is there any way to treat it like an inline function so that I could write
> > something like the following (highly simplified):
>
> I think 7.4 will inline simple SQL functions. Your CASE looks like a good
> candidate.
>
> >    select case when A=1 then 1 when B=1 then 2 else null end
> >    as mailtype, memname from master
> >    where mailtype is not null;

I think it may inline it as an optimization step, I don't know of any
way to shortcut how to write it.  (I'm running 7.4.1.)
--
Mike Nolan

pgsql-general by date:

Previous
From: Shelby Cain
Date:
Subject: Re: postmaster won't start under cygwin after password change
Next
From: Anony Mous
Date:
Subject: pg_dump "what if?"