pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: David Jarvis <thangalin@gmail.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Analysis Function
Date: Fri, 11 Jun 2010 16:20:55 -0400
Message-ID: <12241.1276287655@sss.pgh.pa.us> (raw)
In-Reply-To: <AANLkTim6TrfgLiXM3sTSx6rgXQ3zNLTWBTD_MbU0OPsv@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>

David Jarvis <thangalin@gmail.com> writes:
> dateserial(PG_FUNCTION_ARGS) {
>   int32 p_year = (int32)PG_GETARG_FLOAT8(0);
>   int32 p_month = PG_GETARG_INT32(1);
>   int32 p_day = PG_GETARG_INT32(2);

Er ... why float?  Integer is plenty for the range of years supported by
the PG datetime infrastructure.  The above coding is pretty lousy in terms
of its roundoff and overflow behavior, too.

			regards, tom lane



view thread (30+ messages)  latest in thread

Message-ID: <12241.1276287655@sss.pgh.pa.us>
Permalink:  ../12241.1276287655@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/12241.1276287655@sss.pgh.pa.us

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: tgl@sss.pgh.pa.us, thangalin@gmail.com
  Subject: Re: Analysis Function
  In-Reply-To: <12241.1276287655@sss.pgh.pa.us>

* 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