From 35a3262fe345b12fbc1cc7f89c2e0d35631811f7 Mon Sep 17 00:00:00 2001 From: Oleksandr Shulgin Date: Thu, 11 Jun 2015 12:20:52 +0200 Subject: [PATCH] Expose ReplicationMessage type in extras --- lib/extensions.py | 2 +- lib/extras.py | 5 +++-- psycopg/psycopgmodule.c | 1 + 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/extensions.py b/lib/extensions.py index 216d8ad2..faa8b1de 100644 --- a/lib/extensions.py +++ b/lib/extensions.py @@ -56,7 +56,7 @@ try: except ImportError: pass -from psycopg2._psycopg import adapt, adapters, encodings, connection, cursor, lobject, Xid +from psycopg2._psycopg import adapt, adapters, encodings, connection, cursor, replicationMessage, lobject, Xid from psycopg2._psycopg import string_types, binary_types, new_type, new_array_type, register_type from psycopg2._psycopg import ISQLQuote, Notify, Diagnostics, Column diff --git a/lib/extras.py b/lib/extras.py index 7de48d78..2f32bf12 100644 --- a/lib/extras.py +++ b/lib/extras.py @@ -39,6 +39,7 @@ import psycopg2 from psycopg2 import extensions as _ext from psycopg2.extensions import cursor as _cursor from psycopg2.extensions import connection as _connection +from psycopg2.extensions import replicationMessage as ReplicationMessage from psycopg2.extensions import adapt as _A from psycopg2.extensions import b @@ -515,13 +516,13 @@ class ReplicationCursor(_cursor): else: raise RuntimeError("unrecognized replication slot type") - return self.execute(command) + self.execute(command) def drop_replication_slot(self, slot_name): """Drop streaming replication slot.""" command = "DROP_REPLICATION_SLOT %s" % self.quote_ident(slot_name) - return self.execute(command) + self.execute(command) def start_replication(self, o, slot_type, slot_name=None, start_lsn=None, timeline=0, keepalive_interval=10, options=None): diff --git a/psycopg/psycopgmodule.c b/psycopg/psycopgmodule.c index 27af2112..d44a4b68 100644 --- a/psycopg/psycopgmodule.c +++ b/psycopg/psycopgmodule.c @@ -911,6 +911,7 @@ INIT_MODULE(_psycopg)(void) /* put new types in module dictionary */ PyModule_AddObject(module, "connection", (PyObject*)&connectionType); PyModule_AddObject(module, "cursor", (PyObject*)&cursorType); + PyModule_AddObject(module, "replicationMessage", (PyObject*)&replicationMessageType); PyModule_AddObject(module, "ISQLQuote", (PyObject*)&isqlquoteType); PyModule_AddObject(module, "Notify", (PyObject*)¬ifyType); PyModule_AddObject(module, "Xid", (PyObject*)&xidType);