pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: jeremy@cowgar.com
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #14649: Function Namespace Resolution Bug
Date: Fri, 12 May 2017 14:13:54 -0400
Message-ID: <26979.1494612834@sss.pgh.pa.us> (raw)
In-Reply-To: <20170512174059.1791.21888@wrigleys.postgresql.org>
References: <20170512174059.1791.21888@wrigleys.postgresql.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

jeremy@cowgar.com writes:
> In short, when a CHECK on a column in a different schema references a
> function in public that references another function in public implicitly,
> there is confusion. The workaround is to prefix the function calls with the
> schema.

I don't see any PG bug here.  If you don't schema-qualify the function
reference, then it is dependent on the current search_path, and pg_dump/
pg_restore have their own ideas about how to set search_path.  Even if
those two somehow magically intuited what search_path you're expecting,
this coding would still be fragile since some other user might use a
different search_path than you while accessing the table.  The schema
qualification isn't a "workaround", it's just good coding practice.

			regards, tom lane


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (6+ messages)  latest in thread

Message-ID: <26979.1494612834@sss.pgh.pa.us>
Permalink:  ../26979.1494612834@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/26979.1494612834@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, jeremy@cowgar.com
  Subject: Re: BUG #14649: Function Namespace Resolution Bug
  In-Reply-To: <26979.1494612834@sss.pgh.pa.us>
  References: <20170512174059.1791.21888@wrigleys.postgresql.org> <26979.1494612834@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox