Re: Rules

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Albert Bartoszko" <albertb(at)nt(dot)kegel(dot)com(dot)pl>
Cc: pgsql-general(at)postgresql(dot)org, Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Rules
Date: 2001-11-28 21:49:09
Message-ID: 4936.1006984149@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

"Albert Bartoszko" <albertb(at)nt(dot)kegel(dot)com(dot)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

In response to

  • Rules at 2001-11-28 14:07:51 from Albert Bartoszko

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Stephan Szabo 2001-11-28 21:56:18 Re: Rules
Previous Message Brent R. Matzelle 2001-11-28 20:25:04 Re: Could be a FAQ: prepare/execute in PHP?

Browse pgsql-hackers by date

  From Date Subject
Next Message Stephan Szabo 2001-11-28 21:56:18 Re: Rules
Previous Message Tony Reina 2001-11-28 21:30:46 Questions about SERIAL type