Re: 答复: [ADMIN] sql to grant privilege on sequence

From: Guillaume Lelarge <guillaume(at)lelarge(dot)info>
To: liuyuanyuan <liuyuanyuangogo(at)gmail(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: 答复: [ADMIN] sql to grant privilege on sequence
Date: 2014-07-14 21:05:07
Message-ID: CAECtzeU40c5vYQumEZeVpDeertKhnnCTXSrSCVzK3sLp6zEC1Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

2014-07-14 11:31 GMT+02:00 liuyuanyuan <liuyuanyuangogo(at)gmail(dot)com>:

> Thanks Guillaume! Thanks for your reply !
>
>
>
> Now that, I got the reason.
>
> I knew GRANT ON TABLE still works for sequence, but I think use GRANT ON
> SEQUENCE
>
> in pgAdmin3 of newer version maybe much better. Because GRANT ON SEQUENCE
> is more clear,
>
> and maybe that’s why developers create this syntax especially for
> sequence.
>
> That’s only a suggestion, looking forward to hearing from you later~~
>
>
Well, we have this weird check in pgSequence.cpp:

if (!GetConnection()->BackendMinimumVersion(8, 2))¬
sql += GetGrant(wxT("arwdRxt"), wxT("TABLE ") +
GetQuotedFullIdentifier());¬
else¬
sql += GetGrant(wxT("rwU"), wxT("TABLE ") +
GetQuotedFullIdentifier());¬

This code is as old as 2006 (commit id
2ef0bfe6cb8eb9d2cf117ca654bbbe0d17d0a784), where Dave added "Add support
for PostgreSQL 8.2's CONNECT privilege on databases, and USAGE on
sequences".

Pretty sure he meant SEQUENCE instead of TABLE in the else part :)

Fixed.

Thanks for the report.

--
Guillaume.
http://blog.guillaume.lelarge.info
http://www.dalibo.com

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message liuyuanyuan 2014-07-15 00:59:52 reply: sql to grant privilege on sequence
Previous Message John Scalia 2014-07-14 13:57:00 Re: WAL segment management on a standby