Re: BUG #13687: bug in row_to_json function with '-infinity' timestamp
От | Bruce Momjian |
---|---|
Тема | Re: BUG #13687: bug in row_to_json function with '-infinity' timestamp |
Дата | |
Msg-id | 20151019152501.GE24392@momjian.us обсуждение исходный текст |
Ответ на | Re: BUG #13687: bug in row_to_json function with '-infinity' timestamp ("David G. Johnston" <david.g.johnston@gmail.com>) |
Список | pgsql-bugs |
On Mon, Oct 19, 2015 at 11:22:58AM -0400, David G. Johnston wrote: > Well, the output I see is: > > Â Â Â Â SELECT row_to_json(t) > Â Â Â Â FROM (SELECT '-infinity'::timestamptz) t ; > Â Â Â Â Â Â Â Â row_to_json > Â Â Â Â ---------------------------- > Â Â Â Â Â {"timestamptz":"infinity"} > > I assume the user expects positive infinity. > > > âThe user is expecting negative infinity...which I agree with. Sorry, yeah, I meant negative infinity. > Release notes do indicate this incompatibility: > >>> > When converting values of type date, timestamp or timestamptz to JSON, render > the values in a format compliant with ISO 8601 (Andrew Dunstan) > > Previously such values were rendered according to the current DateStyle > setting; but many JSON processors require timestamps to be in ISO 8601 format. > If necessary, the previous behavior can be obtained by explicitly casting the > datetime value to text before passing it to the JSON conversion function. > â>>>â > > âBut since ISO 8601 doesn't define infinity our implementation of this behavior > is not externally constrained and probably shouldn't be changed. Well, if infinity is not defined, we can output whatever seems logical, and returning +infinity for -infinity seems illogical. -- Bruce Momjian <bruce@momjian.us> http://momjian.us EnterpriseDB http://enterprisedb.com + As you are, so once was I. As I am, so you will be. + + Roman grave inscription +
В списке pgsql-bugs по дате отправления: