Re: [HACKERS] replace GrantObjectType with ObjectType

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: [HACKERS] replace GrantObjectType with ObjectType
Дата
Msg-id d81deff3-b208-c76d-1194-e8f094f96459@2ndquadrant.com
обсуждение исходный текст
Ответ на Re: [HACKERS] replace GrantObjectType with ObjectType  (Rushabh Lathia <rushabh.lathia@gmail.com>)
Список pgsql-hackers
On 12/18/17 02:38, Rushabh Lathia wrote:
> Only motivation is, earlier approach looks more cleaner. Also patch is
> getting bigger - so if we continue with old approach it will make review
> easy. Just in case switch/case approach is a go to, then it can be
> done as part of separate clean up patch.

If find the approach with the giant array harder to maintain because you
typically need to maintain a consistent order between an enum in one
file and arrays in other files, and the only approaches to satisfy this
are hope and 100% test coverage.  And then if you want to reorder or
insert something, you need to do it everywhere at once in a very careful
manner.  In this particular patch, it would also bloat the array even
more, because we don't support grants on all object types, and with the
switch approach we can easily omit those.

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


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

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: [HACKERS] replace GrantObjectType with ObjectType
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: [HACKERS] replace GrantObjectType with ObjectType