Closed GoogleCodeExporter closed 9 years ago
JS doesn't have "date" time but does have Date which corresponds to timestamp
in postgres. And the format of date/timestamp in postgres depends on the
datestyle GUC and I know it's sometimes confusing. If you really need a
consistent date format, you are encouraged to use to_char().
Does this answer your question?
Original comment by umi.tan...@gmail.com
on 29 Mar 2013 at 5:32
Yes I understood that going in, my question is does it make sense to have plv8
output something different than what postgres's datestyle is set to? Would
having any date column output a string that matches the datestyle instead of a
Js Date object make more sense or no?
Original comment by Nitro...@gmail.com
on 29 Mar 2013 at 4:33
I am still not sure what you mean by "output". plv8.execute just returns JS
Date object and the output depends on what you do on it. If you call
toString() on the Date object it'll look different from the standard postgres'
date string format and it is expected as well as I don't see much we can do.
Original comment by umi.tan...@gmail.com
on 1 Apr 2013 at 6:18
Exactly thats my point, does it make more sense to have plv8.execute return a
string object that matches the date style set in postgres for the date column
instead of a JS Date object?
You end up with oddities like '2012-01-20' is returned as
'2012-01-19-00:00:00.000Z' which does not necessarily seem desirable to me,
although I could be in the wrong (I understand they are the same just the
second can be confusing and almost always requires some sort of reformatting to
work with)
Original comment by Nitro...@gmail.com
on 1 Apr 2013 at 2:23
You are comparing apples and oranges. And it is designed in plv8 from the
beginning that plv8.execute should return JS-friendly object instead of plan
string, which was proved to be not a desirable idea in other PLs.
Original comment by umi.tan...@gmail.com
on 2 Apr 2013 at 5:49
Please re-open this issue if you still have concerns.
Original comment by umi.tan...@gmail.com
on 9 Apr 2013 at 7:32
Original issue reported on code.google.com by
Nitro...@gmail.com
on 28 Mar 2013 at 2:11