Re: case statement as inline function?

From: Mike Nolan <nolan(at)gw(dot)tssi(dot)com>
To: dev(at)archonet(dot)com (Richard Huxton)
Cc: pgsql-general(at)postgresql(dot)org (pgsql general list)
Subject: Re: case statement as inline function?
Date: 2004-03-24 18:52:33
Message-ID: 200403241852.i2OIqYcm001471@gw.tssi.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Shelby Cain 2004-03-24 18:53:07 Re: postmaster won't start under cygwin after password change
Previous Message Bill Harris 2004-03-24 18:51:17 Re: postmaster won't start under cygwin after password change