Re: make more use of RoleSpec struct

From: Stephen Frost <sfrost(at)snowman(dot)net>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: make more use of RoleSpec struct
Date: 2016-12-28 15:38:26
Message-ID: 20161228153826.GK18360@tamriel.snowman.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

* Alvaro Herrera (alvherre(at)2ndquadrant(dot)com) wrote:
> Stephen Frost wrote:
> > * Alvaro Herrera (alvherre(at)2ndquadrant(dot)com) wrote:
>
> > > 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..?
>
> Yeah, I was of two minds when writing that para. Maybe roleSpecsToIds
> (and all similar functions, if any others exist) has a limited enough
> caller base that it's trivial to audit that no bogus callsite exists.

Well, I think an Assert() is fine to make sure someone doesn't add a new
call that passes in something else where we don't have the compile-time
type checking happening.

Thanks!

Stephen

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Fabien COELHO 2016-12-28 15:42:28 Re: proposal: session server side variables
Previous Message Alvaro Herrera 2016-12-28 15:35:09 Re: Reporting planning time with EXPLAIN