From: Tom Lane <tgl@sss.pgh.pa.us>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Bruce Momjian <bruce@momjian.us>
Cc: Daniele Varrazzo <daniele.varrazzo@gmail.com>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Subject: Re: [BUGS] extract(epoch from infinity) is not 0
Date: Wed, 13 Jul 2011 17:22:36 -0400
Message-ID: <10833.1310592156@sss.pgh.pa.us> (raw)
In-Reply-To: <F5B7B9C4-66FD-4E47-9FBC-02EAB14B491E@gmail.com>
References: <201107131843.p6DIh8923252@momjian.us>
<F5B7B9C4-66FD-4E47-9FBC-02EAB14B491E@gmail.com>
Robert Haas <robertmhaas@gmail.com> writes:
> On Jul 13, 2011, at 1:43 PM, Bruce Momjian <bruce@momjian.us> wrote:
>> I see:
>>
>> if (TIMESTAMP_NOT_FINITE(timestamp))
>> {
>> result = 0;
>> PG_RETURN_FLOAT8(result);
>> }
>>
>> Does anyone object to changing this?
> It's sort of non-obvious that either behavior is better than the other. We might just be replacing one surprising behavior with another.
Well, this code path is not much except a punt. If we're going to touch
it we should think through the behavior for all field types, not just
epoch.
I think a reasonable case could be made for throwing error or returning
NaN (indicating "indeterminate") for most field types. I can see
returning +/- infinity for epoch --- are there any others where that's
sane?
regards, tom lane
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-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, robertmhaas@gmail.com, bruce@momjian.us, daniele.varrazzo@gmail.com, pgsql-hackers@postgresql.org
Subject: Re: [BUGS] extract(epoch from infinity) is not 0
In-Reply-To: <10833.1310592156@sss.pgh.pa.us>
References: <201107131843.p6DIh8923252@momjian.us> <F5B7B9C4-66FD-4E47-9FBC-02EAB14B491E@gmail.com> <10833.1310592156@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