brianc / node-pg-types

Type parsing for node-postgres
271 stars 56 forks source link

Is the Date parsing fix in the current pg release? #138

Closed jcamato closed 2 years ago

jcamato commented 2 years ago

I found https://github.com/brianc/node-pg-types/issues/50 because I noticed my Postgres DATE columns were returning as 'yyyy-MM-ddThh:mm:ss.mssZ' instead of 'yyyy-MM-dd'. It looks like the fix https://github.com/brianc/node-pg-types/pull/121 by @ianwalter was merged almost two years ago, but I am still encountering this date parsing issue on pg 8.7.3 and node 14.18.3.

Currently I am using the workaround mentioned in the first issue

// Prevent node-postgres from converting Postgres DATE type
pg.types.setTypeParser(1082, function (value) {
  return value;
});
bendrucker commented 2 years ago

pg no but this package yes. If you'd like to discuss upgrading the types in a pg release you can open an issue there or a PR.