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