[OPEN-ILS-DEV] Postgres schema search path considered harmful

Dan Scott dan at coffeecode.net
Fri Dec 2 13:01:21 EST 2011


On Fri, Dec 2, 2011 at 12:45 PM, John Craig
<jc-mailinglist at alphagconsulting.com> wrote:

<snip>

> I would vote for not depending upon the schema search path (that is, do not use a schema search path, but rather always fully qualify object names). Ensuring that the code is as human-friendly as possible (including to newbies) seems to me to be a goal that is even more important in the open source world than it is in a closed-source project. This was brought home to me very strongly yesterday when I had an intern running the 2.0 to 2.1 upgrade script. Having encountered the error message from Postgres that said this:
>
> ERROR: function array_remove_item_by_value(text[], unknown) does not exist
> ...
> HINT: No function matches the given name and argument types. You might need to add explicit type casts.

<snip>

I could counter with "relying exclusively on explicitly qualified
functions considered harmful" as an instance of "evergreen.is_json()"
that was fully qualified failing during my upgrade process because the
version I had was "public.is_json()". If we had relied on the search
path instead of an explicitly qualified function, that wouldn't have
been a problem. In that case.

Problems happen, we have to find the real reasons and fix them,
there's no silver bullet.


More information about the Open-ils-dev mailing list