Re: [HACKERS] Cache lookup errors with functions manipulation objectaddresses - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: [HACKERS] Cache lookup errors with functions manipulation objectaddresses
Date
Msg-id 20170720140402.7nrm56yjig7q2r3r@alvherre.pgsql
Whole thread Raw
In response to Re: [HACKERS] Cache lookup errors with functions manipulation object addresses  (Michael Paquier <michael.paquier@gmail.com>)
Responses Re: [HACKERS] Cache lookup errors with functions manipulation object addresses
List pgsql-hackers
Michael Paquier wrote:

> - getObjectDescription and getObjectIdentity are called in quite a
> couple of places. We could have those have a kind of missing_ok, but
> as the status is just for adding cache lookup errors I have kept the
> interface simple as this keeps the code in objectaddress.c more simple
> as well. getObjectIdentity is used mainly in sepgsql, which I have not
> compiled yet so I may have missed something :) getObjectDescription is
> used in more places in the backend code, but I am not much into
> complicating the objaddr API with this patch more.

I think the addition of checks everywhere for NULL return is worse.
Let's add a missing_ok flag instead, so that most callers can just trust
that they get a non null value if they don't want to deal with that
case.

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: [HACKERS] Cache lookup errors with functions manipulation object addresses
Next
From: Michael Paquier
Date:
Subject: Re: [HACKERS] Cache lookup errors with functions manipulation object addresses