From be2909dbf96f7bdb18ba97d8f32639a787b0cfa9 Mon Sep 17 00:00:00 2001 From: Chris Lalancette <clalance@redhat.com> Date: Tue, 7 Sep 2010 16:13:48 -0400 Subject: [PATCH] Implement notifies. This no longer exists in the upstream ruby-pg project, but this source is pulled from the older 0.7.1 project to retain compatibility. Signed-off-by: Chris Lalancette <clalance@redhat.com> --- ext/postgres.c | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-) diff --git a/ext/postgres.c b/ext/postgres.c index e9bb032..d3a04bf 100644 --- a/ext/postgres.c +++ b/ext/postgres.c @@ -1060,6 +1060,14 @@ pgconn_endcopy(obj) return Qnil; } +static VALUE +pgconn_notifies(obj) + VALUE obj; +{ + PQnotifies(get_pgconn(obj)); + return Qnil; +} + static void notice_proxy(self, message) VALUE self; @@ -2697,6 +2705,7 @@ Init_postgres() rb_define_method(rb_cPGconn, "putline", pgconn_putline, 1); rb_define_method(rb_cPGconn, "getline", pgconn_getline, 0); rb_define_method(rb_cPGconn, "endcopy", pgconn_endcopy, 0); + rb_define_method(rb_cPGconn, "notifies", pgconn_notifies, 0); rb_define_method(rb_cPGconn, "on_notice", pgconn_on_notice, 0); rb_define_method(rb_cPGconn, "transaction_status", pgconn_transaction_status, 0); rb_define_method(rb_cPGconn, "protocol_version", pgconn_protocol_version, 0); -- 1.7.2.2