Re: adding stuff to parser, question

From: Joshua Tolley <eggyknap(at)gmail(dot)com>
To: Grzegorz Jaskiewicz <gj(at)pointblue(dot)com(dot)pl>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, David Fetter <david(at)fetter(dot)org>, pgsql-hackers Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: adding stuff to parser, question
Date: 2009-02-01 00:05:23
Message-ID: 20090201000522.GA5858@uber
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Grzegorz Jaskiewicz 2009-02-01 00:12:47 Re: adding stuff to parser, question
Previous Message Marko Kreen 2009-01-31 23:24:13 Re: pgevent warnings on mingw