Closed danielknell closed 9 years ago
I've tried your code with correct username, db and password and it works OK. Then I've changed it to invalid credentials and got the your error you've got.
I would double-check that your dsn
is correct (with stand-alone psycopg2).
psycopg2
async behavior when connecting to db server through Unix socket is rather subtle, that's why the error is so confusing.
Also bear in mind that if you want support for automatic reconnected you need to pass raise_connect_errors=False
to Pool
constructor.
thanks, it seems the error was localhost vs 127.0.0.1 as i did not want to use the unix socket, although psycopg2 seems to do the right then when connecting synchronously, so the fact it was defaulting to unix sockets threw me.
all working, just a pretty confusing error message.
Yeah, they all do that, mysql as well.
I'm glad you've solved your issue and thanks for the feedback.
I was evaluating momoko for a project and noticed it was throwing errors if i instantiate the connection pool, trying to track this down i took the example from the momoko manual and that is also throwing the error,
this is running on OSX with the home brew version of python 2.7.3