mirror of
https://github.com/postgres/postgres.git
synced 2025-07-28 23:42:10 +03:00
Render infinite date/timestamps as 'infinity' for json/jsonb
Commit ab14a73a6c
raised an error in these cases and later the
behaviour was copied to jsonb. This is what the XML code, which we
then adopted, does, as the XSD types don't accept infinite values.
However, json dates and timestamps are just strings as far as json is
concerned, so there is no reason not to render these values as
'infinity'.
The json portion of this is backpatched to 9.4 where the behaviour was
introduced. The jsonb portion only affects the development branch.
Per gripe on pgsql-general.
This commit is contained in:
@ -111,6 +111,12 @@ SET LOCAL TIME ZONE -8;
|
||||
select to_json(timestamptz '2014-05-28 12:22:35.614298-04');
|
||||
COMMIT;
|
||||
|
||||
select to_json(date '2014-05-28');
|
||||
|
||||
select to_json(date 'Infinity');
|
||||
select to_json(timestamp 'Infinity');
|
||||
select to_json(timestamptz 'Infinity');
|
||||
|
||||
--json_agg
|
||||
|
||||
SELECT json_agg(q)
|
||||
|
Reference in New Issue
Block a user