Re: Function's LEAST, GREATEST and DECODE (Oracle vararg - Mailing list pgsql-patches

From Pavel Stehule
Subject Re: Function's LEAST, GREATEST and DECODE (Oracle vararg
Date
Msg-id Pine.LNX.4.44.0506220441430.8113-100000@kix.fsv.cvut.cz
Whole thread Raw
In response to Re: Function's LEAST, GREATEST and DECODE (Oracle vararg  (Bruce Momjian <pgman@candle.pha.pa.us>)
List 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


pgsql-patches by date:

Previous
From: Neil Conway
Date:
Subject: Re: pg_restore: fix bogosity
Next
From: Pavel Stehule
Date:
Subject: Re: Function's LEAST, GREATEST and DECODE (Oracle vararg