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

From Stephen Frost
Subject Re: [HACKERS] make more use of RoleSpec struct
Date
Msg-id 20161228152337.GI18360@tamriel.snowman.net
Whole thread Raw
In response to Re: [HACKERS] make more use of RoleSpec struct  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Responses Re: [HACKERS] make more use of RoleSpec struct
List pgsql-hackers
* Alvaro Herrera (alvherre@2ndquadrant.com) 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().

Maybe inside of an Assert() though..?

Thanks!

Stephen

pgsql-hackers by date:

Previous
From: Stephen Frost
Date:
Subject: Re: [HACKERS] Reporting planning time with EXPLAIN
Next
From: David Fetter
Date:
Subject: Re: [HACKERS] Hooks