pg_dump/restore issue with schemas - Mailing list pgsql-bugs

From Richard Huxton
Subject pg_dump/restore issue with schemas
Date
Msg-id 200310031009.57273.dev@archonet.com
Whole thread Raw
Responses Re: pg_dump/restore issue with schemas
List 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

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: 7.3.4: memory leak in fe-exec.c:279 (realloc)
Next
From: Tom Lane
Date:
Subject: Re: pg_dump/restore issue with schemas