Re: [GENERAL] Rules - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [GENERAL] Rules
Date
Msg-id 4936.1006984149@sss.pgh.pa.us
Whole thread Raw
Responses Re: [GENERAL] Rules
Re: [GENERAL] Rules
List pgsql-hackers
"Albert Bartoszko" <albertb@nt.kegel.com.pl> writes:
> [ src/interfaces/libpq++/examples/testlibpq2.sql fails ]
> What is wrong?

As best I can tell, psql is falling down on the job: it's not treating
square brackets as something to be matched up, as it does with
parentheses.  It ships this command to the backend as two separate
queries.  Trying it with psql -e shows what's happening:

regression=# CREATE RULE r1 AS ON INSERT TO TBL1 DO [INSERT INTO TBL2 values (new.i); NOTIFY TBL2];
CREATE RULE r1 AS ON INSERT TO TBL1 DO [INSERT INTO TBL2 values (new.i);
ERROR:  parser: parse error at or near ""
 NOTIFY TBL2];
ERROR:  parser: parse error at or near "]"
regression=#

While this clearly ought to be fixed, I think it's a bit late in the
cycle to consider fixing it for 7.2, especially seeing as how no
functionality is lost (multi-rule actions work fine if you put
parentheses rather than square brackets around them).

For 7.3, we should either fix psql or remove the option to use square
brackets in rule action lists.  Comments anyone?

            regards, tom lane

pgsql-hackers by date:

Previous
From: reina@nsi.edu (Tony Reina)
Date:
Subject: Questions about SERIAL type
Next
From: Bill Studenmund
Date:
Subject: Re: FW: [ppa-dev] Severe bug in debian - phppgadmin opens