Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-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: C:\WINDOWS\Escritorio\notify_rules. patch.gz
Description: text/plain (1.0 KB)

Responses

pgsql-hackers by date

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

pgsql-patches by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group