Re: [HACKERS] replace GrantObjectType with ObjectType

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: [HACKERS] replace GrantObjectType with ObjectType
Дата
Msg-id 20171012084310.wky6yc3zyt4xjwkp@alvherre.pgsql
обсуждение исходный текст
Ответ на Re: [HACKERS] replace GrantObjectType with ObjectType  (Michael Paquier <michael.paquier@gmail.com>)
Ответы Re: [HACKERS] replace GrantObjectType with ObjectType  (Michael Paquier <michael.paquier@gmail.com>)
Список pgsql-hackers
Michael Paquier wrote:
> On Thu, Oct 12, 2017 at 7:55 AM, Peter Eisentraut
> <peter.eisentraut@2ndquadrant.com> wrote:
> > It seems to me that having ACL_OBJECT_* symbols alongside OBJECT_*
> > symbols is not useful and leads to duplication.  Digging around in the
> > past suggests that we used to have a lot of these command-specific
> > symbols but got rid of them over time, except that the ACL stuff was
> > never touched.  The attached patch accomplishes that.

+1 for this.

> -bool
> -EventTriggerSupportsGrantObjectType(GrantObjectType objtype)
> -{
> -   switch (objtype)
> -   {
> -       case ACL_OBJECT_DATABASE:
> -       case ACL_OBJECT_TABLESPACE:
> -           /* no support for global objects */
> -           return false;
> By removing that, if any GRANT/REVOKE support is added for another
> object type, then EventTriggerSupportsObjectType would return true by
> default instead of getting a compilation failure.

Yeah, we've found it useful to remove default: clauses in some switch
blocks so that we get compile warnings when we forget to add a new type
(c.f. commit e84c0195980f).  Let's not add any more of those.

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Konstantin Knizhnik
Дата:
Сообщение: Re: [HACKERS] Slow synchronous logical replication
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: [HACKERS] Discussion on missing optimizations