Re: pg_dump does not honor namespaces when functions are used in index

From: Jean-Baptiste Quenot <jbq(at)caraldi(dot)com>
To: Greg Stark <gsstark(at)mit(dot)edu>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Robert Haas <robertmhaas(at)gmail(dot)com>, Thom Brown <thombrown(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: pg_dump does not honor namespaces when functions are used in index
Date: 2010-06-18 08:31:29
Message-ID: AANLkTimoElJn5Ci9foVPmD07NbYpcoYbAJRAUP8vseAM@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2010/6/17 Greg Stark <gsstark(at)mit(dot)edu>:
> On Thu, Jun 17, 2010 at 4:08 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>>> I actually wonder if we shouldn't automatically tag plpgsql functions
>>> with the search_path in effect at the time of their creation (as if
>>> the user had done ALTER FUNCTION ... SET search_path=...whatever the
>>> current search path is...).
>>
>> That would be extremely expensive and not very backwards-compatible.
>> In the case at hand, just writing "RETURN bar.bar();" would be the
>> best-performing solution.
>>
>
> I wonder if we should have a mode for plpgsql functions where all name
> lookups are done at definition time So the bar() function would be
> resolved to bar.bar() and stored that way permanently so that pg_dump
> dumped the definition as bar.bar().
>
> That would be probably just as good as setting the search path on the
> function for most users and better for some. It would have the same
> problem with dynamic sql that a lot of things have though.

+1 IMHO PG should dump the bar() function call as bar.bar() to be
safe. Using fully qualified function name is what I did in my source
code, to work around this problem.
--
Jean-Baptiste Quenot

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2010-06-18 08:35:37 Re: trace_recovery_messages
Previous Message Daniel Ng 2010-06-18 06:54:24 Re: to enable O_DIRECT within postgresql