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

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 (view raw or flat)
Thread:
Lists: pgsql-generalpgsql-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

pgsql-hackers by date

Next:From: Stephan SzaboDate: 2001-11-28 21:56:18
Subject: Re: Rules
Previous:From: Tony ReinaDate: 2001-11-28 21:30:46
Subject: Questions about SERIAL type

pgsql-general by date

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

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