Re: SQL/JSON in PostgreSQL

From: "Sven R(dot) Kunze" <srkunze(at)mail(dot)de>
To: Andres Freund <andres(at)anarazel(dot)de>, Oleg Bartunov <obartunov(at)gmail(dot)com>
Cc: David Steele <david(at)pgmasters(dot)net>, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>, Nikita Glukhov <n(dot)gluhov(at)postgrespro(dot)ru>, Teodor Sigaev <teodor(at)postgrespro(dot)ru>, Alexander Korotkov <a(dot)korotkov(at)postgrespro(dot)ru>, andrew Dunstan <andrew(at)dunslane(dot)net>
Subject: Re: SQL/JSON in PostgreSQL
Date: 2017-03-07 21:43:16
Message-ID: 70d3d53c-4494-07fb-1118-5c63d5f6917e@mail.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

about the datetime issue: as far as I know, JSON does not define a
serialization format for dates and timestamps.

On the other hand, YAML (as a superset of JSON) already supports a
language-independent date(time) serialization format
(http://yaml.org/type/timestamp.html)

I haven't had a glance into the SQL/JSON standard yet and a quick search
didn't reveal anything. However, reading your test case here
https://github.com/postgrespro/sqljson/blob/5a8a241/src/test/regress/sql/sql_json.sql#L411
it seems as if you intend to parse all strings in the form of
"YYYY-MM-DD" as dates. This is problematic in case a string happens to
look like this but is not intended to be a date.

Just for the sake of completeness: YAML solves this issue by omitting
the quotation marks around the date string (just as JSON integers have
no quotations marks around them).

Regards,
Sven

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Mark Dilger 2017-03-07 21:43:32 Re: Hash support for grouping sets
Previous Message Andres Freund 2017-03-07 21:41:25 Re: WIP: [[Parallel] Shared] Hash