Re: Since '2001-09-09 01:46:40'::timestamp microseconds are lost when extracting epoch

From: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, Thomas Munro <thomas(dot)munro(at)gmail(dot)com>, Petr Fedorov <petr(dot)fedorov(at)phystech(dot)edu>
Subject: Re: Since '2001-09-09 01:46:40'::timestamp microseconds are lost when extracting epoch
Date: 2020-12-15 14:03:31
Message-ID: 2fb99632-9302-6509-78ce-3aaed3fd7f40@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

Here is a new patch for this. This now follows the implementation that
Tom has suggested: Leave date_part() alone, add a new set of extract()
functions, and map the SQL EXTRACT construct to those. I have basically
just copied over the implementations from my previous patch and placed
them next to the existing date_part() implementations. So all the
behavior is still the same as in the previous patches.

One thing I still need to look into is how to not lose all the test
coverage for date_part(). But that should be fairly mechanical, so I'm
leaving it off in this version.

--
Peter Eisentraut
2ndQuadrant, an EDB company
https://www.2ndquadrant.com/

Attachment Content-Type Size
v4-0001-Change-return-type-of-EXTRACT-to-numeric.patch text/plain 65.4 KB

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Uwe Benner 2020-12-15 14:14:51 Re: BUG #16775: Problem building with Kerberos (--with-gssapi) support on Windows
Previous Message Тарасов Георгий Витальевич 2020-12-15 10:27:53 RE: BUG #16773: GSSAPI + Msys2/mingw64 + setenv() issue.

Browse pgsql-hackers by date

  From Date Subject
Next Message Konstantin Knizhnik 2020-12-15 14:06:30 Re: On login trigger: take three
Previous Message Andrew Dunstan 2020-12-15 13:47:15 Re: TAP tests aren't using the magic words for Windows file access