Re: Analysis Function - Mailing list pgsql-performance

From Magnus Hagander
Subject Re: Analysis Function
Date
Msg-id AANLkTik5qoLZUtGnakVXIYUTHZoOTYvLlHqBFY-w2GaB@mail.gmail.com
Whole thread Raw
In response to Re: Analysis Function  (David Jarvis <thangalin@gmail.com>)
Responses Re: Analysis Function
Re: Analysis Function
List pgsql-performance
On Sun, Jun 13, 2010 at 21:19, David Jarvis <thangalin@gmail.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/

pgsql-performance by date:

Previous
From: Magnus Hagander
Date:
Subject: Re: Analysis Function
Next
From: AI Rumman
Date:
Subject: query tuning help