diff --git a/psycopg/replication_connection_type.c b/psycopg/replication_connection_type.c index 774d6502..75871fe1 100644 --- a/psycopg/replication_connection_type.c +++ b/psycopg/replication_connection_type.c @@ -107,7 +107,7 @@ replicationConnection_init(replicationConnectionObject *self, self->conn.autocommit = 1; Py_INCREF(cursor); - self->conn.cursor_factory = cursor; + self->conn.cursor_factory = TO_STATE(cursor); exit: Py_XDECREF(item);