Re: Function's LEAST, GREATEST and DECODE (Oracle vararg

From: Pavel Stehule <stehule(at)kix(dot)fsv(dot)cvut(dot)cz>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: pgsql-patches(at)postgresql(dot)org, <neilc(at)samurai(dot)com>, <tgl(at)sss(dot)pgh(dot)pa(dot)us>, <david(at)fetter(dot)org>
Subject: Re: Function's LEAST, GREATEST and DECODE (Oracle vararg
Date: 2005-06-21 19:06:12
Message-ID: Pine.LNX.4.44.0506212055370.4872-100000@kix.fsv.cvut.cz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Hello,

I sended version with only LEAST and GREATEST
http://archives.postgresql.org/pgsql-patches/2005-06/msg00185.php

this patch contains diff files for NEXT_DAY and LAST_DAY function too,
which I think are generally usefull.

There is duplicity with CASE.

Regards
Pavel

On Tue, 21 Jun 2005, Bruce Momjian wrote:

>
> This patch looks good. I know greater/least are seen as valuable, but
> do we want decode()? It seems OK to me but I thought there was concern
> about it in the past because it duplicated some existing functionality.
>
> ---------------------------------------------------------------------------
>
> Pavel Stehule wrote:
> > Hello
> >
> > This patch contains three oracle users missing functions. But I
> > hope can be usefull for all PostgreSQL users (users vote me ;-) Certainly
> > LEAST and GREATEST, which has not analogy. Using of DECODE is similar
> > CASE, but with some differences. There exist some workarounds in plpgsql,
> > but are ugly and neefective, or impossible (function DECODE rotate type of
> > args). All functions share code.
> >
> > David, please, can you enhance documentation?
> >
> > pokus=# select least(1,2,3,4);
> > least
> > -------
> > 1
> > (1 row)
> >
> > pokus=# select greatest(1,2,3,4);
> > greatest
> > ----------
> > 4
> > (1 row)
> >
> > pokus=# select decode('c','a',2,1);
> > decode
> > --------
> > 1
> >
> > Best regards
> > Pavel Stehule
> >
> >
> >
>
> Content-Description:
>
> [ Attachment, skipping... ]
>
> >
> > ---------------------------(end of broadcast)---------------------------
> > TIP 6: Have you searched our list archives?
> >
> > http://archives.postgresql.org
>
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2005-06-21 19:09:26 Re: Function's LEAST, GREATEST and DECODE (Oracle vararg
Previous Message Josh Berkus 2005-06-21 19:00:56 Why is checkpoint so costly?

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2005-06-21 19:09:26 Re: Function's LEAST, GREATEST and DECODE (Oracle vararg
Previous Message Bruce Momjian 2005-06-21 18:46:36 Re: Function's LEAST, GREATEST and DECODE (Oracle vararg polymorphic