Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating to the newest version of pg-types #2547

Open
mwanago opened this issue May 16, 2021 · 9 comments
Open

Updating to the newest version of pg-types #2547

mwanago opened this issue May 16, 2021 · 9 comments

Comments

@mwanago
Copy link

mwanago commented May 16, 2021

Currently, the pg library uses a very old version of pg-types.

Is there something, in particular, that is stopping us from updating to the newest version of the pg-types library?

@mwanago mwanago changed the title Using to the newest version of pg-types Updating to the newest version of pg-types May 16, 2021
@mwanago
Copy link
Author

mwanago commented Dec 24, 2021

@brianc What do you think?

@brianc
Copy link
Owner

brianc commented Dec 27, 2021

I think there are some backwards incompatible changes but I'm fine to do a semver bump and up the version of pg types. I'll start looking into this.

@sgronblo
Copy link

sgronblo commented Mar 4, 2022

I just noticed that we would need the latest version of pg-types to work with date without having it turn into mangled Javascript dates. @brianc were you able to take a look into what those breaking changes would be?

@charmander
Copy link
Collaborator

@sgronblo You can always override the date parser before pg-types is upgraded, note.

@hpohlmeyer
Copy link

hpohlmeyer commented Mar 16, 2023

Are there any plans on how to proceed? The old pg-types parses timezone-less timestamps in the system timezone, while the new one parses it as UTC date. One could argue what the right behavior would be, but since most people set their database timezone to UTC it seems to be an improvement. Further proof for that would be sequelize/sequelize#3000, which would also be fixed by updating pg-types in pg.

For now, I could work around this using npm overrides to force pg to resolve to the latest pg-types package.

"overrides": {
  "pg": {
    "pg-types": "^4.0.1"
  }
},

@nwalters512
Copy link

I'd love to see this happen to pick up the new version of postgres-interval that was introduced in brianc/node-pg-types#126!

@tleiroblox
Copy link

the old postgres-date also have some serious performance issues which was mitigated in bendrucker/postgres-date#21, any plan to continue work on this?

@charmander
Copy link
Collaborator

@tleiroblox Was there some kind of pathological date case that I missed? 3x speedup on parsing doesn’t sound like “serious performance issues”.

@tleiroblox
Copy link

@tleiroblox Was there some kind of pathological date case that I missed? 3x speedup on parsing doesn’t sound like “serious performance issues”.

For time series data that has date in every row, parseDate old implementation alone could easily cost more than 50% of the cpu cycles pg used, which often become the bottleneck of the whole node application. It's also not memory efficient that can result in more gc (which also lead to cpu usage)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants