From: | "Kevin O'Gorman" <kogorman(at)pacbell(dot)net> |
---|---|
To: | PostgreSQL General List <pgsql-general(at)hub(dot)org> |
Subject: | Is this a bug or a feature? |
Date: | 2000-10-19 02:35:06 |
Message-ID: | 39EE5DDA.A8234DB4@pacbell.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
I'm trying to understand rules, because I'm about to use them
heavily in some research I'm doing on query optimization.
It seems a natural.
I've notices what looks like an anomaly. I can define a rule
with two delete commands like this:
> CREATE RULE rule1 AS ON delete TO dummy DO INSTEAD
> (delete from d2 where id=old.id; delete from d3 where id=old.id);
and it even works.
I can define a rule that does a random SELECT command like so:
>CREATE RULE rule2 AS ON insert TO dummy DO INSTEAD
> select * from d2;
And this works too, although of course it looks odd.
But I cannot seem to get two selects in the same rule. When I
try something like this:
> CREATE RULE rule3 AS ON insert TO dummy DO INSTEAD
> (select * from d2; select * from d3;);
I get a complaint from the parser around the ; (it doesn't say
which ;). The syntax looks like a direct parallel to the
syntax which worked for deletes, so I was hoping it would
work.
So the question becomes: is this a bug or a feature?
If it's a feature, I'd like it explained. If it's a
bug, then I'll probably just go fix it. I really want
to be able to put multiple queries in a rule so that
I can do weird things to them, time the results, and
call it research (thereby maybe earning a PhD).
I'm utterly new to PostgreSQL (did some stuff in
Oracle for my masters), so I'm not going to presume
I can tell at a glance whether this ought to work
or not. I could use at least a little help.
If there's going to be a problem with doing this sort
of thing, I'd like to know as soon as possible so I
don't just bash my head on walls.
++ kevin
--
Kevin O'Gorman (805) 650-6274 mailto:kogorman(at)pacbell(dot)net
Permanent e-mail forwarder: mailto:Kevin.O'Gorman(dot)64(at)Alum(dot)Dartmouth(dot)org
At school: mailto:kogorman(at)cs(dot)ucsb(dot)edu
Web: http://www.cs.ucsb.edu/~kogorman/index.html
Web: http://trixie.kosman.via.ayuda.com/~kevin/index.html
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2000-10-19 02:50:43 | Re: rules *very* slow? |
Previous Message | Brian Edginton | 2000-10-19 02:30:18 | Re: [HACKERS] pg_connect error |