Search Postgresql Archives

Re: Intervals and ISO 8601 duration

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 1/13/23 15:32, Ken Tanzer wrote:
On Fri, Jan 13, 2023 at 3:03 PM Adrian Klaver <adrian.klaver@xxxxxxxxxxx

Cheers,
Ken

(*) These are probably bad suggestions, but something like...

      EXTRACT ( (RAWHOURS|RAWDAYS|RAWMICROSECONDS) ... ?
      Or a function RAWEXTRACT( HOURS|DAYS|MICROSECONDS ) ?

Close as I can get:


WITH inters AS (
    SELECT
        extract(epoch from '1 day 2 hours'::interval) AS i1,
        extract(epoch from '26 hours'::interval) AS i2
)
SELECT
    i1,
    i2,
    i1=i2 AS "Equal?"
FROM inters;

 i1      |      i2      | Equal?
--------------+--------------+--------
 93600.000000 | 93600.000000 | t



-- Adrian Klaver
    adrian.klaver@xxxxxxxxxxx <mailto:adrian.klaver@xxxxxxxxxxx>



--
AGENCY Software
A Free Software data system
By and for non-profits
/http://agency-software.org/ <http://agency-software.org/>/
/https://demo.agency-software.org/client <https://demo.agency-software.org/client>/
ken.tanzer@xxxxxxxxxxxxxxxxxxx <mailto:ken.tanzer@xxxxxxxxxxxxxxxxxxx>
(253) 245-3801

Subscribe to the mailing list <mailto:agency-general-request@xxxxxxxxxxxxxxxxxxxxx?body=subscribe> to
learn more about AGENCY or
follow the discussion.

--
Adrian Klaver
adrian.klaver@xxxxxxxxxxx






[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux