Re: [HACKERS] Inconsistent syntax in GRANT

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: josh(at)agliodbs(dot)com
Cc: PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: [HACKERS] Inconsistent syntax in GRANT
Date: 2006-01-05 18:20:06
Message-ID: 200601051820.k05IK6u26518@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Josh Berkus wrote:
> Folks,
>
> Just got tripped up by this:
>
> GRANT SELECT ON table1 TO someuser;
> GRANT SELECT ON table1_id_seq TO someuser;
> .... both work
>
> However,
> GRANT SELECT ON TABLE table1 TO someuser;
> ... works, while ....
> GRANT SELECT ON SEQUENCE table1_id_seq TO someuser;
> ... raises an error.
>
> This is inconsistent. Do people agree with me that the parser should
> accept "SEQUENCE" there, since the optional object name works for all
> other objects? Is there some technical reason this is difficult to do?

The following patch allows VIEW and SEQUENCE for GRANT. I didn't add
checks for relkind, figuring it wasn't worth it, right?

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

Attachment Content-Type Size
unknown_filename text/plain 2.3 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2006-01-05 18:59:18 Re: [HACKERS] Inconsistent syntax in GRANT
Previous Message Bruce Momjian 2006-01-05 17:47:41 Re: Inconsistent syntax in GRANT

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2006-01-05 18:59:18 Re: [HACKERS] Inconsistent syntax in GRANT
Previous Message Bruce Momjian 2006-01-05 17:47:41 Re: Inconsistent syntax in GRANT