pg_dump/restore issue with schemas

From: Richard Huxton <dev(at)archonet(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: pg_dump/restore issue with schemas
Date: 2003-10-03 09:09:57
Message-ID: 200310031009.57273.dev@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Seems to be on 7.3 and 7.4beta (not tested the newest - probably be next week
before I get a chance to test that).

The situation seems to be:

table public.a
function reports.f()
The function refers to "a" without the full schema (i.e. not as "public.a")
The function was originally defined with its name as "reports.f" while
search_path = public...

On dump/restore the search_path is set to reports, pg_catalog so of course you
get a "no relation a" error

The work-around is obviously to manually edit the SET search_path line above
the function to include the public schema. Obviously, you could alter
pg_dump/restore to set search_path = reports,public,pg_catalog but that won't
help you in the (unlikely?) case that the original path was foo,pg_catalog.

Not sure what a general fix for this would look like without keeping track of
what search_path settings were at the time the function was originally
designed.
--
Richard Huxton
Archonet Ltd

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Alexandr S 2003-10-03 14:43:36 bug reporting
Previous Message Tom Lane 2003-10-02 14:46:36 Re: 7.3.4: memory leak in fe-exec.c:279 (realloc)