-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
DeprecationWarning: Buffer() is deprecated due to security and usability issues #2426
Comments
Oh yes I need to upgrade. I know there are some backwards incompatible changes which is why I've waited so long. I think I should schedule a pg@9.0 upgrade for some time in January and make it a bundle of breaking changes. @charmander got any other breaking changes that come to mind? I'd like to deprecate the "query queue" concept in 9.0 - add a deprecation warning if you queue a query while another one is still in flight. Thoughts? |
@brianc All of that sounds good!
We can open issues to discuss them if they sound worth talking about! Also, for pg-pool, there are breaking change ideas queued up, like returning client wrappers that stop working when they’re returned to the pool; those would also be waiting on a new major pg version eventually, so maybe they can be revisited too for this major. |
@vitaly-t Your “generic” package isn’t libpq-compatible. It’s MongoDB-compatible. |
Is there any update on this? We get this warning on all our Lambda invocations and it's quite noisy. How is the proposed upgrade to pg@9.0 progressing? Is there an issue I can follow for updates on that? Does anyone know of a workaround? Would it be practical to update the 2.x branch of |
Any plans to fix this? |
Want to do a bump in this. We've our monitor system flooded with |
Hey this issue is causing crashes for me (although due to an obscure & annoying mesh of dependencies that isn't really pg's fault). There is a bug in some versions of node: nodejs/node#53075 that mean that the Buffer() deprecation warning instead crashes in WASM environments. I'm using vercel (whose current node version (20.15.X) is currently vulnerable to the above bug and neondatabase that uses pg as a dependency. Is there any idea when this might get addressed? I'll probably be looking for alternative solutions on my end anyway but thought it was worth bumping |
@danny-hunt You can add the newer version of pg-types as a dependency, then pass it to pg as the |
Hi there! While I wait for a new release to fix how BYTEA is handled in node, I added these lines of code to my pg client initialization: import PG from 'pg';
PG.types.setTypeParser(PG.types.builtins.BYTEA, function (value: string) {
return value ? `0x${value.slice(2)}`.toLowerCase() : null;
}); This change prevents an error from being logged every time a BYTEA is read. I hope this helps! |
Also a good workaround. If you want to be compatible with the defaults, it’s PG.types.setTypeParser(PG.types.builtins.BYTEA, (value: string) => Buffer.from(value, 'hex')); |
└─┬ pg@8.5.1
└─┬ pg-types@2.2.0
└── postgres-bytea@1.0.0
This issue is happening because of using old version of pg-types module.
Do you have a plan to update pgtypes to 3.x from 2.x?
The latest version of pg-types is using new version of postgres-bytea and this issue has been fixed there.
The text was updated successfully, but these errors were encountered: