Re: adding stuff to parser, question - Mailing list pgsql-hackers

From Joshua Tolley
Subject Re: adding stuff to parser, question
Date
Msg-id 20090201000522.GA5858@uber
Whole thread Raw
In response to Re: adding stuff to parser, question  (Grzegorz Jaskiewicz <gj@pointblue.com.pl>)
Responses Re: adding stuff to parser, question  (Grzegorz Jaskiewicz <gj@pointblue.com.pl>)
List pgsql-hackers
On Sat, Jan 31, 2009 at 05:40:57PM +0000, Grzegorz Jaskiewicz wrote:
> On 31 Jan 2009, at 17:30, Andrew Dunstan wrote:
>> But the syntax you posted does not do this at all. Where does it
>> restrict the grant to a single schema, like the syntax above?
> I am just starting the attempt here, obviously since I admit that my
> parser skills are next to none - I didn't address such issue.
> So far, testing this change - I can do issue "GRANT SELECT ON ALL TABLES
> TO xxx", and it parses well.

Your desire to figure out how to add stuff to the parser is certainly
commendable, and you might consider continuing down the road you've started on
for that purpose alone. But the desire of others on this list to remain close
to the SQL standard is equally commendable, and unlikely to go away :) If your
main purpose is to get the feature implemented, whether or not you learn how
to add new syntax, you might consider writing a function instead. This
function might take parameters such as the privilege to grant and the user to
grant it to, and be called something like this:

SELECT my_grant_function('someuser', 'someprivilege');

This would do what you need, and in no way conflict with the standard if one
day it covers the feature in question.

- Josh / eggyknap

pgsql-hackers by date:

Previous
From: Marko Kreen
Date:
Subject: Re: pgevent warnings on mingw
Next
From: Grzegorz Jaskiewicz
Date:
Subject: Re: adding stuff to parser, question