Notify with Rules bugs?

From: sergiop(at)sinectis(dot)com(dot)ar
To: pgsql-hackers(at)postgresql(dot)org, pgsql-patches(at)postgresql(dot)org
Cc: lrivero(at)exa(dot)unicen(dot)edu(dot)ar, vferra(at)exa(dot)unicen(dot)edu(dot)ar, jdoorn(at)exa(dot)unicen(dot)edu(dot)ar
Subject: Notify with Rules bugs?
Date: 2000-12-29 19:58:02
Message-ID: 200012291958.QAA15000@sinectis.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Hi!

I compiled the 7.1 version of the snapshot dated on the December 18 (on i386
Linux Red Hat 6.1).
Using the notify in the rule actions I get some errors and I suppose they are
bugs.

The first one when the rule is triggered:

[postgres@ postgres]$ createdb test
CREATE DATABASE

test=# create table test_notify(one int);
CREATE

test=# create rule i_test_notify as on insert to test_notify do notify ONE;
CREATE

test=# insert into test_notify values (1);
pqReadData() -- backend closed the channel unexpectedly.
This probably means the backend terminated abnormally
before or while processing the request.
The connection to the server was lost. Attempting reset: Failed.
!#

The second one (exactly, this is not a bug) when I try to see the rule
definition.

test=# select * from pg_rules;
ERROR: get_ruledef of i_test_notify: query command type 5 not implemented yet

Finally, when a dump of the database is performed:

[postgres@ postgres]$ pg_dump test > test.pgdump
dumpRules(): SELECT failed for rules associated with table "test_notify".
Explanation from backend: 'ERROR: get_ruledef of i_test_notify: query
command type 5 not implemented yet
'.

This error is produced in the same way as in the previous case but in this
case, there is an additional problem since the dump aborts.

Within the patch I attach, you can find the solution for these problems:

To solve the first error the function gatherRewriteMeta in RewriteHandler.c was
modified

To solve the second and third errors the function get_utility_query_def in
ruleutils.c was added. The function get_query_def in ruleutils.c was modified
as well.

Would someone like to review it?

Thnaks.

Sergio.

Attachment Content-Type Size
C:\WINDOWS\Escritorio\notify_rules. patch.gz text/plain 1.0 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Nathan Myers 2000-12-29 20:02:19 Re: Assuming that TAS() will succeed the first time is verboten
Previous Message Bruce Momjian 2000-12-29 19:00:13 Re: [HACKERS] About PQsetClientEncoding(), "SET NAMES", and "SET CLIENT_ENCODING"

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2000-12-29 22:09:22 Re: [HACKERS] Notify with Rules bugs?
Previous Message Bruce Momjian 2000-12-29 19:00:13 Re: [HACKERS] About PQsetClientEncoding(), "SET NAMES", and "SET CLIENT_ENCODING"