Re: [HACKERS] SQL/JSON in PostgreSQL - Mailing list pgsql-hackers

From Oleg Bartunov
Subject Re: [HACKERS] SQL/JSON in PostgreSQL
Date
Msg-id CAF4Au4w=64HJo1Vm_gwUNr+jb74cS==2xz9KsZ7X4BPZNXjL=g@mail.gmail.com
Whole thread Raw
In response to Re: [HACKERS] SQL/JSON in PostgreSQL  (Nico Williams <nico@cryptonector.com>)
List pgsql-hackers


On Mon, Mar 13, 2017 at 9:24 AM, Nico Williams <nico@cryptonector.com> wrote:
On Thu, Mar 09, 2017 at 07:12:07PM +0100, Sven R. Kunze wrote:
> From my day-to-day work I can tell, the date(time) type is the only missing
> piece of JSON to make it perfect for business applications (besides, maybe,
> a "currency" type).

And a binary type.  And a chunked-string type (to avoid having to escape
strings).  And an interval type.  And...

Let's first have this basic implementation in postgres, then we'll add extendability support not only for types, but also for operators.
Right now I see in our regression tests:

select _jsonpath_object(
'["10.03.2017 12:34 +1", "10.03.2017 12:35 +1", "10.03.2017 12:36 +1", "10.03.2017 12:35 +2", "10.03.2017 12:35 -2"]',
'$[*].datetime("dd.mm.yyyy HH24:MI TZH") ? (@ < "10.03.2017 12:35 +1".datetime("dd.mm.yyyy HH24:MI TZH"))'
);
     _jsonpath_object
--------------------------
 "2017-03-10 14:34:00+03"
 "2017-03-10 13:35:00+03"
(2 rows)
 

pgsql-hackers by date:

Previous
From: Artur Zakirov
Date:
Subject: Re: [HACKERS] IF NOT EXISTS option for CREATE SERVER and CREATE USERMAPPING statements
Next
From: Magnus Hagander
Date:
Subject: Re: [HACKERS] Typo in snapbuild.c