From: Tom Lane <tgl@sss.pgh.pa.us>
To: Thomas Munro <thomas.munro@gmail.com>
Cc: Petr Fedorov <petr.fedorov@phystech.edu>
Cc: pgsql-bugs@postgresql.org
Subject: Re: Since '2001-09-09 01:46:40'::timestamp microseconds are lost when extracting epoch
Date: Sun, 01 Dec 2019 17:59:11 -0500
Message-ID: <18389.1575241151@sss.pgh.pa.us> (raw)
In-Reply-To: <CA+hUKGKgHUbFNKRhvodn4mVU-oqje+HA7jTg_XrWRo4UGhFoqg@mail.gmail.com>
References: <42b73d2d-da12-ba9f-570a-420e0cce19d9@phystech.edu>
<CA+hUKGKgHUbFNKRhvodn4mVU-oqje+HA7jTg_XrWRo4UGhFoqg@mail.gmail.com>
Thomas Munro <thomas.munro@gmail.com> writes:
> On Sat, Nov 30, 2019 at 10:28 PM Petr Fedorov <petr.fedorov@phystech.edu> wrote:
>> Obviously, it is due to the fact that extract epoch returns double
>> precision which in turn has 15 decimal digits precision.
> I guess this deviation from the SQL standard ("exact numeric") made
> sense when PostgreSQL used double for timestamps, but would break a
> lot of queries if we changed it.
Hmmm ... well, now that you mention it, would it really break things
if we made it return numeric? There's an implicit cast to float8,
so it seems like queries requiring that type would still work.
There might be a performance-related argument against switching,
perhaps.
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 using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, thomas.munro@gmail.com, petr.fedorov@phystech.edu
Subject: Re: Since '2001-09-09 01:46:40'::timestamp microseconds are lost when extracting epoch
In-Reply-To: <18389.1575241151@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