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

8.2.1 introduced an error when handling option properties that are objects (still a problem in 8.3.0) #2306

Closed
SamMaxwell opened this issue Aug 9, 2020 · 2 comments

Comments

@SamMaxwell
Copy link

the options object that is passed into pg has a property that is an object
{user:"postgres",database:"dvdrental",options:{appName:"Simplicity",enableArithAbort:false,encrypt:false}}

that used to work in 8.2.0, but ever since 8.2.1 (and still in 8.3.0) we now get the following error

TypeError [ERR_INVALID_ARG_TYPE]: The "string" argument must be of type string or an instance of Buffer or ArrayBuffer. Received an instance of Object at Function.byteLength (buffer.js:727:11) at Writer.addCString (<snipped>\node_modules\pg-protocol\dist\buffer-writer.js:41:30) at Object.startup (<snipped>\node_modules\pg-protocol\dist\serializer.js:9:32) at Connection.startup (<snipped>\node_modules\pg\lib\connection.js:118:31) at Connection.<anonymous> (<snipped>\node_modules\pg\lib\client.js:118:11) at Connection.emit (events.js:315:20) at Socket.<anonymous> (<snipped>\node_modules\pg\lib\connection.js:49:10) at Object.onceWrapper (events.js:421:28) at Socket.emit (events.js:327:22) at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1127:10) { code: 'ERR_INVALID_ARG_TYPE' }

I do not expect that the options property will accomplish anything useful with postgreSQL, but the code is db-independent (and like I said, it worked prior to 8.2.1)

@charmander
Copy link
Collaborator

Duplicate of #2290

@charmander charmander marked this as a duplicate of #2290 Aug 9, 2020
@charmander
Copy link
Collaborator

If you’re seeing this in 8.2.1, that is a mistake (it should be only 8.3.0 and later, according to the tags on 06cdf3e), but releasing 8.2.2 to fix that doesn’t seem like it would be too helpful.

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

2 participants