Re: Oracle Decode Function

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Marc Lavergne <mlavergne-pub(at)richlava(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Oracle Decode Function
Date: 2002-07-25 15:40:17
Message-ID: 18835.1027611617@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Marc Lavergne <mlavergne-pub(at)richlava(dot)com> writes:
> If you're asking about whether a custom function can have vararg
> parameters, the answer appears to depend on the CREATE FUNCTION
> syntax.

Can't do it, though you could imagine creating a family of functions
of the same name and different numbers of parameters. Trying to
emulate DECODE this way would have a much worse problem: what's the
datatype of the parameters? (Or the result?)

Use CASE; it does more than DECODE *and* is ANSI-standard.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Hannu Krosing 2002-07-25 17:09:08 Re: why?
Previous Message Tom Lane 2002-07-25 14:50:26 Re: bug in COPY