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-22 02:56:18
Message-ID: Pine.LNX.4.44.0506220441430.8113-100000@kix.fsv.cvut.cz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

On Tue, 21 Jun 2005, Bruce Momjian wrote:

> Pavel Stehule wrote:
> > Hello,
> >
> > I sended version with only LEAST and GREATEST
> > http://archives.postgresql.org/pgsql-patches/2005-06/msg00185.php
>
> OK, did you remove DECODE for a reason?
>
o simplify patch
o decode can be added in future if will be requirement

> > this patch contains diff files for NEXT_DAY and LAST_DAY function too,
> > which I think are generally usefull.
> >
> > There is duplicity with CASE.
>
> I didn't think we needed NEXT_DAY and LAST_DAY because we have +
> interval like + '1 day'. We decided that, right?
>
next_day not equal date + 1day, but like next monday, ... look to doc.
next_day (date, varchar) -- varchar = sunday|monday|...

last_day is very often used function. Really. I can substitute

create or replace function last_day(date) returns date $$
select date_trunc('month', $1 + interval '1month') - 1;
$$ language sql;

but I think can be usefull (for first day we have date_drunc, for
last_date nothing)

regards
Pavel

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2005-06-22 02:57:31 Re: Schedule for 8.1 feature freeze
Previous Message Josh Berkus 2005-06-22 02:49:51 Re: pl/pgsql: END verbosity

Browse pgsql-patches by date

  From Date Subject
Next Message Pavel Stehule 2005-06-22 02:59:05 Re: Function's LEAST, GREATEST and DECODE (Oracle vararg
Previous Message Josh Berkus 2005-06-22 02:49:51 Re: pl/pgsql: END verbosity