Re: Analysis Function

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: David Jarvis <thangalin(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>, pgsql-performance <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Analysis Function
Date: 2010-06-14 09:03:37
Message-ID: AANLkTik5qoLZUtGnakVXIYUTHZoOTYvLlHqBFY-w2GaB@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Sun, Jun 13, 2010 at 21:19, David Jarvis <thangalin(at)gmail(dot)com> wrote:
> Hi,
>
>> It's not immediately obvious what the default value of "timezone"
>> will be?
>
> The system's locale, like now(); documentation can clarify.
>
> By named parameter, I meant default value. You could construct a timestamp
> variable using:
>
>   construct_timestamp( year := 1900, hour := 1 )
>
> When I read that code, the first thing I think it should return is:
>
>   1900-01-01 01:00:00.0000-07
>
> I agree construct_timestamp( hour := 1 ) and construct_date() are errors:
> year is required.

Does it make sense to allow minutes when hours isn't specified? Or
should we simply say that for each of the date and the time part, to
specify at <level n> you need to have everything from the top up to
<level n-1> specified? E.g. month requires year to be specified, day
requires both year and month etc?

> I prefer to_timestamp and to_date over the more verbose construct_timestamp.

Yeah, I agree with that.

--
Magnus Hagander
Me: http://www.hagander.net/
Work: http://www.redpill-linpro.com/

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message AI Rumman 2010-06-14 10:41:26 query tuning help
Previous Message Magnus Hagander 2010-06-14 09:01:47 Re: Analysis Function