Closed edqallen closed 5 years ago
You should be getting back Date
objects, not strings formatted like that. To override the type parser for timestamptz
s, see https://github.com/brianc/node-pg-types#use – val => val
.
Sorry, you're right! It's giving back a Date object, it's the default Date to string handler that is messing things up when I do a ...Object.values(rowIn).join...
Simple query of e.g.
SELECT * FROM foo
is returning rows with timestamps (TIMESTAMP WITH TIME ZONE) that are not valid in insert/update statements. For example:"Thu Mar 10 2016 16:43:01 GMT+0000 (Coordinated Universal Time)"
which is not a valid timestamp format for use in a subsequent SQL statement such as an INSERT or UPDATE.Is there an option I can give to the library to force timestamps to be returned unmolested? I can't (easily) select a named column and cast it, as I am creating a somewhat generic tool that needs to operate on a list of tables whos schemas are unknown beforehand.