interval type additional option

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: interval type additional option
Date: 2019-01-31 13:22:37
Message-ID: CAFj8pRCopkH6MsOUBDzDrdiHRefuRvta8euGWbZb-R7TnYv6cg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi

I have a value '400 days 30 sec':: interval

I don't understand why cast

postgres=# select '400days 30sec'::interval minute to second;
+-------------------+
| interval |
+-------------------+
| 400 days 00:00:30 |
+-------------------+
(1 row)

produce 400 days

or

postgres=# create table foo(a interval minute to second);
CREATE TABLE
postgres=# insert into foo values('400 days');
INSERT 0 1
postgres=# select * from foo;
+----------+
| a |
+----------+
| 400 days |
+----------+
(1 row)

What is sense of this feature?

Regards

Pavel

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2019-01-31 13:44:35 Re: [HACKERS] proposal - Default namespaces for XPath expressions (PostgreSQL 11)
Previous Message Andres Freund 2019-01-31 13:21:08 Re: Add --include-table-data-where option to pg_dump, to export only a subset of table data