mirror of
https://github.com/psycopg/psycopg2.git
synced 2024-11-14 13:06:34 +03:00
Add dbname=replication for physical replication type.
This commit is contained in:
parent
fbcf99ad07
commit
e61db578cf
|
@ -110,6 +110,10 @@ replicationConnection_init(PyObject *obj, PyObject *args, PyObject *kwargs)
|
||||||
if (!PyMapping_HasKeyString(kwargs, "replication")) {
|
if (!PyMapping_HasKeyString(kwargs, "replication")) {
|
||||||
PyMapping_SetItemString(kwargs, "replication", Text_FromUTF8(repl));
|
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);
|
Py_DECREF(dsn);
|
||||||
if (!(dsn = psyco_make_dsn(NULL, NULL, kwargs))) { goto exit; }
|
if (!(dsn = psyco_make_dsn(NULL, NULL, kwargs))) { goto exit; }
|
||||||
|
|
Loading…
Reference in New Issue
Block a user