pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Magnus Hagander <magnus@hagander.net>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: David Jarvis <thangalin@gmail.com>
Cc: Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>
Cc: pgsql-performance <pgsql-performance@postgresql.org>
Subject: Re: Analysis Function
Date: Sun, 13 Jun 2010 17:49:50 +0200
Message-ID: <AANLkTimNvCCFgRng7eUm-OMBbx2tkSN7KL2ScXcj2j2x@mail.gmail.com> (raw)
In-Reply-To: <14107.1276443739@sss.pgh.pa.us>
References: <AANLkTikihIMleazgqo1NhLo7LA5Tiujz4TIfBL1agxAp@mail.gmail.com>
	<AANLkTikZKwBCR8QfGph3aH34A2dJ2NQyOjq-Pt3eZ3_z@mail.gmail.com>
	<4C119B3E.3090608@squeakycode.net>
	<AANLkTinjUmGWmB3jsjj-6w_44c0K7f_wSrH_1TALPaOY@mail.gmail.com>
	<m34ohahrp4.fsf@passepartout.tim-landscheidt.de>
	<AANLkTik3l6uedzVJLqn-nueNva46NAFwxbpSe1XSc26_@mail.gmail.com>
	<m3typ9hl6a.fsf@passepartout.tim-landscheidt.de>
	<AANLkTikPcYh1vMxVynxGnD4RCch8-DMixiGK1v9kO17Z@mail.gmail.com>
	<AANLkTim6TrfgLiXM3sTSx6rgXQ3zNLTWBTD_MbU0OPsv@mail.gmail.com>
	<12241.1276287655@sss.pgh.pa.us>
	<AANLkTil8w33uYIadqvvecTEvTmY9aNvstpuiy1tryyT7@mail.gmail.com>
	<AANLkTinPNQZv_9BS1fkoLPXzcBZe8FFv77PBRhPR-GpL@mail.gmail.com>
	<4C14746F.9050603@enterprisedb.com>
	<AANLkTikBJ4fOqQm4A_sq68SlWnJKkjYKA2L02C4vWQwO@mail.gmail.com>
	<AANLkTil3RK4qbICWfbyJNJi7lxyNnFHwWlhaLmsZh3Rn@mail.gmail.com>
	<14107.1276443739@sss.pgh.pa.us>

On Sun, Jun 13, 2010 at 17:42, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Magnus Hagander <magnus@hagander.net> writes:
>> On Sun, Jun 13, 2010 at 09:38, David Jarvis <thangalin@gmail.com> wrote:
>>> Does it makes sense to use named parameter notation for the first value (the
>>> year)? This could be potentially confusing:
>
>> How so? If it does named parameters, why not all?
>
> There's no reason not to allow the year parameter to be named.  What
> I think it shouldn't have is a default.  OTOH I see no good reason
> not to allow the other ones to have defaults.  (We presumably want
> timezone to default to the system timezone setting, but I wonder how
> we should make that work --- should an empty string be treated as
> meaning that?)

Umm. NULL could be made to mean that, or we could provicde two
different versions - one that takes TZ and one that doesn't.


>>> Similarly, to_timestamp() ...? Seems meaningless without at least a full
>>> date and an hour.
>
>> Agreed.
>
> No, I think it's perfectly sane to allow month/day to default to 1
> and h/m/s to zeroes.
>
> I do think it might be a good idea to have two functions,
> construct_timestamp yielding timestamptz and construct_date
> yielding date (and needing only 3 args).  When you only want
> a date, having to use construct_timestamp and cast will be
> awkward and much more expensive than is needed (timezone
> rotations aren't real cheap).

And a third, construct_time(), no?


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



view thread (30+ messages)  latest in thread

Message-ID: <AANLkTimNvCCFgRng7eUm-OMBbx2tkSN7KL2ScXcj2j2x@mail.gmail.com>
Permalink:  ../AANLkTimNvCCFgRng7eUm-OMBbx2tkSN7KL2ScXcj2j2x@mail.gmail.com/
Also on:    postgresql.org/message-id/AANLkTimNvCCFgRng7eUm-OMBbx2tkSN7KL2ScXcj2j2x@mail.gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-performance@postgresql.org
  Cc: magnus@hagander.net, tgl@sss.pgh.pa.us, thangalin@gmail.com, heikki.linnakangas@enterprisedb.com
  Subject: Re: Analysis Function
  In-Reply-To: <AANLkTimNvCCFgRng7eUm-OMBbx2tkSN7KL2ScXcj2j2x@mail.gmail.com>
  References: <AANLkTikihIMleazgqo1NhLo7LA5Tiujz4TIfBL1agxAp@mail.gmail.com> <AANLkTikZKwBCR8QfGph3aH34A2dJ2NQyOjq-Pt3eZ3_z@mail.gmail.com> <4C119B3E.3090608@squeakycode.net> <AANLkTinjUmGWmB3jsjj-6w_44c0K7f_wSrH_1TALPaOY@mail.gmail.com> <m34ohahrp4.fsf@passepartout.tim-landscheidt.de> <AANLkTik3l6uedzVJLqn-nueNva46NAFwxbpSe1XSc26_@mail.gmail.com> <m3typ9hl6a.fsf@passepartout.tim-landscheidt.de> <AANLkTikPcYh1vMxVynxGnD4RCch8-DMixiGK1v9kO17Z@mail.gmail.com> <AANLkTim6TrfgLiXM3sTSx6rgXQ3zNLTWBTD_MbU0OPsv@mail.gmail.com> <12241.1276287655@sss.pgh.pa.us> <AANLkTil8w33uYIadqvvecTEvTmY9aNvstpuiy1tryyT7@mail.gmail.com> <AANLkTinPNQZv_9BS1fkoLPXzcBZe8FFv77PBRhPR-GpL@mail.gmail.com> <4C14746F.9050603@enterprisedb.com> <AANLkTikBJ4fOqQm4A_sq68SlWnJKkjYKA2L02C4vWQwO@mail.gmail.com> <AANLkTil3RK4qbICWfbyJNJi7lxyNnFHwWlhaLmsZh3Rn@mail.gmail.com> <14107.1276443739@sss.pgh.pa.us> <AANLkTimNvCCFgRng7eUm-OMBbx2tkSN7KL2ScXcj2j2x@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox