I am trying to run pg_dump (or even psql) over our postgresql server v13, with binaries from v13 and v16. Both don’t work for me, but do work for my colleagues that are not on Mac, not sure if it’s related to that.
When I try to run:
pg_dump -U grails --verbose --host=<host> --port=<port> --format=plain <db_name> > <target_file>
or even simple:
psql -U grails --host=.. --port=..
I get the following:
pg_dump: error: connection to server at "...", port ... failed: FATAL: no PostgreSQL user name specified in startup packet
connection to server at "...", port ... failed: FATAL: no PostgreSQL user name specified in startup packet
pg_dump(71055,0x1db08dec0) malloc: *** error for object 0x92: pointer being freed was not allocated
pg_dump(71055,0x1db08dec0) malloc: *** set a breakpoint in malloc_error_break to debug
[1] 71055 abort pg_dump --verbose --host=... --port=... -U grails --format=plain
The user name is clearly specified as parameter and my colleagues have no problem. The malloc errors are weird too. What might be happening?
2
Answers
Seems like the problem is with the brew version of Postgres. I tried installing Postgres with their installer from the official website and I am not running into the issues that I have when using binaries I fetched from homebrew.
This issue (which I also faced) seems to be caused by an incompatibility/bug between Postgres and openssl version 3.2.0. Downgrading to openssl version 3.1.4 (as documented here for homebrew users) worked for me as a workaround.