"Kevin O'Gorman" <kogorman@pacbell.net> writes:
> But I cannot seem to get two selects in the same rule.
> So the question becomes: is this a bug or a feature?
The writer of the grammar seemed to think it was a feature, because
the productions for CREATE RULE go out of their way to prevent it.
I do not see any value in multiple SELECTs per se --- what are you
expecting will happen with the results of the additional SELECTs?
It does seem like some action queries with a SELECT as the tail end
would make perfect sense, although the grammar currently disallows
that.
I also do not see that it makes sense to allow a SELECT in a rule
that is for a non-SELECT event condition, though your examples show
that the system fails to enforce that. The average client app would
not be prepared to see results coming back from a non-SELECT query,
so I think allowing this is not a good thing.
Finally, it'd probably be a good thing to implement semantic
restrictions like these in post-processing, not in grammar rules,
so that a message more meaningful than "parse error near ;" can
be reported.
Feel free to propose and implement a more consistent behavior...
regards, tom lane