pg.ddx.io pgsql-general@postgresql.org mailing list archivehelp / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Ken Tanzer <ken.tanzer@gmail.com>
Cc: Adrian Klaver <adrian.klaver@aklaver.com>
Cc: Sebastien Flaesch <sebastien.flaesch@4js.com>
Cc: pgsql-general <pgsql-general@lists.postgresql.org>
Subject: Re: Intervals and ISO 8601 duration
Date: Fri, 13 Jan 2023 19:57:15 -0500
Message-ID: <892688.1673657835@sss.pgh.pa.us> (raw)
In-Reply-To: <CAD3a31Vk7z_ADWt8qtySB+An8aFTGmYvT5979Da0JGhDoy3yUg@mail.gmail.com>
References: <AM9P191MB1286AD77B5FBAF4640E7274AB0FD9@AM9P191MB1286.EURP191.PROD.OUTLOOK.COM>
<953416.1673536094@sss.pgh.pa.us>
<CAD3a31XW8iqrZ+uB7if+YUgRjk_=9YQOJRJVBc5__yGRsgypQA@mail.gmail.com>
<53c0b4d4-b80a-a35b-ce18-61058794c9bb@aklaver.com>
<CAD3a31UP79wrZZTRFtP4sPvgOy7TZg2v6FmPzXYdAAnaOdnuiQ@mail.gmail.com>
<13f80fd5-6baf-e272-54c7-e72e32280643@aklaver.com>
<CAD3a31XM7TczB9aY2AA3Ld7PFLuwLra3dxqPu2zGd5F0Kb9w2Q@mail.gmail.com>
<d66d3ff9-2e85-253f-4637-cc488954f760@aklaver.com>
<CAD3a31Vk7z_ADWt8qtySB+An8aFTGmYvT5979Da0JGhDoy3yUg@mail.gmail.com>
Ken Tanzer <ken.tanzer@gmail.com> writes:
> Not really. My original question was:
>> [since intervals are stored internally as months, days and microseconds...]
>> What Postgres actually stores for an interval is three fields:
>> months, days, and microseconds.
>> *Is there a way to view/extract this raw data for any given interval?*
Given what extract() provides,
stored months = years * 12 + months
stored days = days
stored usec = reconstruct from hours+minutes+seconds+microseconds
Perhaps it wouldn't be a bad idea to provide a couple more extract()
keywords to make that easier.
regards, tom lane
view thread (24+ messages) latest in thread
Message-ID: <892688.1673657835@sss.pgh.pa.us> Permalink: ../892688.1673657835@sss.pgh.pa.us/ Also on: postgresql.org/message-id/892688.1673657835@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 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-general@postgresql.org Cc: tgl@sss.pgh.pa.us, ken.tanzer@gmail.com, adrian.klaver@aklaver.com, sebastien.flaesch@4js.com Subject: Re: Intervals and ISO 8601 duration In-Reply-To: <892688.1673657835@sss.pgh.pa.us> References: <AM9P191MB1286AD77B5FBAF4640E7274AB0FD9@AM9P191MB1286.EURP191.PROD.OUTLOOK.COM> <953416.1673536094@sss.pgh.pa.us> <CAD3a31XW8iqrZ+uB7if+YUgRjk_=9YQOJRJVBc5__yGRsgypQA@mail.gmail.com> <53c0b4d4-b80a-a35b-ce18-61058794c9bb@aklaver.com> <CAD3a31UP79wrZZTRFtP4sPvgOy7TZg2v6FmPzXYdAAnaOdnuiQ@mail.gmail.com> <13f80fd5-6baf-e272-54c7-e72e32280643@aklaver.com> <CAD3a31XM7TczB9aY2AA3Ld7PFLuwLra3dxqPu2zGd5F0Kb9w2Q@mail.gmail.com> <d66d3ff9-2e85-253f-4637-cc488954f760@aklaver.com> <CAD3a31Vk7z_ADWt8qtySB+An8aFTGmYvT5979Da0JGhDoy3yUg@mail.gmail.com> <892688.1673657835@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