Re: [HACKERS] make more use of RoleSpec struct - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: [HACKERS] make more use of RoleSpec struct
Date
Msg-id d32f2cd1-e67a-4f5a-c6c5-f5ee55198c63@2ndquadrant.com
Whole thread Raw
In response to [HACKERS] make more use of RoleSpec struct  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
List pgsql-hackers
On 12/28/16 9:53 AM, Alvaro Herrera wrote:
> Peter Eisentraut wrote:
>> Here is a small cleanup patch to make more use of the RoleSpec
>> struct/node throughout the parser to avoid casts and make the code more
>> self-documenting.
> 
> This makes sense to me.  I started to do this at some point when I was
> writing RoleSpec; eventually got annoyed about fixing the fallout (I was
> working to get somebody else's patch committed) and went back to how it
> is.  Glad to see it done.
> 
> The only functional issue might be the removal of the IsA() checks.  If
> we don't cast any Node before passing it to any of those functions,
> there should be no problem because any misfeasance will be reported as a
> compile-time warning.  Perhaps it's worth adding IsA() checks in loops
> such as the one in roleSpecsToIds().

Committed with an extra Assert there for good measure.

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



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [HACKERS] Improving RLS planning
Next
From: Cynthia Shang
Date:
Subject: Re: [HACKERS] [PATCH] Rename pg_switch_xlog to pg_switch_wal