From e61db578cfc6b8ae18ffac41f2719c05cb04bb00 Mon Sep 17 00:00:00 2001 From: Oleksandr Shulgin Date: Fri, 30 Oct 2015 13:00:55 +0100 Subject: [PATCH] Add dbname=replication for physical replication type. --- psycopg/replication_connection_type.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/psycopg/replication_connection_type.c b/psycopg/replication_connection_type.c index 16c52414..154a0ddd 100644 --- a/psycopg/replication_connection_type.c +++ b/psycopg/replication_connection_type.c @@ -110,6 +110,10 @@ replicationConnection_init(PyObject *obj, PyObject *args, PyObject *kwargs) if (!PyMapping_HasKeyString(kwargs, "replication")) { PyMapping_SetItemString(kwargs, "replication", Text_FromUTF8(repl)); } + /* with physical specify dbname=replication for .pgpass lookup */ + if (self->type == REPLICATION_PHYSICAL) { + PyMapping_SetItemString(kwargs, "dbname", Text_FromUTF8("replication")); + } Py_DECREF(dsn); if (!(dsn = psyco_make_dsn(NULL, NULL, kwargs))) { goto exit; }