Re: [HACKERS] replace GrantObjectType with ObjectType

From: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
To: Rushabh Lathia <rushabh(dot)lathia(at)gmail(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Stephen Frost <sfrost(at)snowman(dot)net>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [HACKERS] replace GrantObjectType with ObjectType
Date: 2017-12-19 20:03:33
Message-ID: d81deff3-b208-c76d-1194-e8f094f96459@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2017-12-19 20:12:41 Re: [HACKERS] replace GrantObjectType with ObjectType
Previous Message Robert Haas 2017-12-19 20:01:03 Re: vacuum vs heap_update_tuple() and multixactids