Re: value returned by EXTRACT, date_part - Mailing list pgsql-sql

From Tom Lane
Subject Re: value returned by EXTRACT, date_part
Date
Msg-id 3563362.1598717072@sss.pgh.pa.us
Whole thread Raw
In response to Re: value returned by EXTRACT, date_part  (John Lumby <johnlumby@hotmail.com>)
List pgsql-sql
John Lumby <johnlumby@hotmail.com> <DM6PR06MB55625C1A9319BC921F4FB4ACA3530@DM6PR06MB5562.namprd06.prod.outlook.com>
writes:
> What is not clear to me is how the "components" (aka "subfields") of an
> interval are defined.

The spec says that year,month,day,hour,minute,second are independent
fields.  Postgres doesn't implement it quite that way: we treat the
basic fields as being months, days, and (micro)seconds, folding the
other values into those for storage.  That's why "14 months" comes out
as "1 year 2 months", for example.

            regards, tom lane



pgsql-sql by date:

Previous
From: John Lumby
Date:
Subject: Re: value returned by EXTRACT, date_part
Next
From: Christophe Pettus
Date:
Subject: Re: Crossing/Rotating table rows to rows and columns