Some time ago I noticed "small problems" working with data (types) from json subquery (brianc/node-postgres#1876). I know that there are many similar issues, but now I had to include different time zones and "things" looks worse...
Consider The Experiment
with (postgresql.conf) timezone = 'Europe/Warsaw'or (sql) SET TIMEZONE = 'Europe/Warsaw'and (node) $ env TZ='Europe/Warsaw' node server.js
and query:
SELECT
current_setting('TIMEZONE') AS "TZ_current",
now() AS "now_______",
now()::timestamptz AS "now_tstz__",
now()::timestamp AS "now_ts____",
now() AT TIME ZONE 'Europe/Warsaw' AS "now_WAW___",
now() AT TIME ZONE 'UTC' AS "now_UTC___",
(SELECT row_to_json(r) FROM (
SELECT
now() AS "now_______",
now()::timestamptz AS "now_tstz__",
now()::timestamp AS "now_ts____",
now() AT TIME ZONE 'Europe/Warsaw' AS "now_WAW___",
now() AT TIME ZONE 'UTC' AS "now_UTC___"
) r );
Some time ago I noticed "small problems" working with data (types) from json subquery (brianc/node-postgres#1876). I know that there are many similar issues, but now I had to include different time zones and "things" looks worse...
Consider The Experiment
with (postgresql.conf)
timezone = 'Europe/Warsaw'
or (sql)SET TIMEZONE = 'Europe/Warsaw'
and (node)$ env TZ='Europe/Warsaw' node server.js
and query:
the results look like this:
and for me this is a Real Problem with default (js date) type.
Maybe another argument for #50 – Do not return DATE fields as Javascript Date – ???
Originally posted by @veriKami in https://github.com/brianc/node-postgres/issues/1876#issuecomment-482978817