From: | Nathan Wagner <nw+pg(at)hydaspes(dot)if(dot)org> |
---|---|
To: | pgsql-hackers(at)postgresql(dot)org |
Subject: | fortnight interval support |
Date: | 2015-10-27 13:52:11 |
Message-ID: | 20151027135211.GA690@granicus.if.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Mon, Oct 26, 2015 at 01:58:52PM -0400, Robert Haas wrote:
> Aw, you're no fun. select '1 fortnight'::interval => '14 days' would be cool.
Patch attached...
:)
% psql -p 5433 -d template1 -h localhost
psql (9.4.5, server 9.6devel)
WARNING: psql major version 9.4, server major version 9.6.
Some psql features might not work.
Type "help" for help.
template1=# select current_date;
date
------------
2015-10-27
(1 row)
template1=# select '1 fortnight'::interval;
interval
----------
14 days
(1 row)
template1=# select current_date + '1 fortnight'::interval;
?column?
---------------------
2015-11-10 00:00:00
(1 row)
template1=# select current_date + '1.3 fortnight'::interval;
?column?
---------------------
2015-11-14 04:48:00
(1 row)
template1=# select current_date + '1.3 fortnights'::interval;
?column?
---------------------
2015-11-14 04:48:00
(1 row)
--
nw
Attachment | Content-Type | Size |
---|---|---|
fortnight.patch | text/plain | 2.7 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | Craig Ringer | 2015-10-27 13:59:33 | Re: remaining open items |
Previous Message | Craig Ringer | 2015-10-27 13:51:43 | Re: Disabling START TRANSACTION for a SuperUser |