Re: set search_path and pg_dumpall - Mailing list pgsql-hackers

From Tom Lane
Subject Re: set search_path and pg_dumpall
Date
Msg-id 9701.1074539492@sss.pgh.pa.us
Whole thread Raw
In response to Re: set search_path and pg_dumpall  (Robert Treat <xzilla@users.sourceforge.net>)
List pgsql-hackers
Robert Treat <xzilla@users.sourceforge.net> writes:
> I can't be the only one forsee frustration from users who typo the set
> search_path statement and then can't figure out why their tables aren't
> showing up... can we emit a warning that not all of the schemas in the
> search path were found? 

Since no one else commented, I've followed your suggestion.  As of CVS
tip, you get a NOTICE not ERROR in this case:

regression=# set search_path = public,z;
ERROR:  schema "z" does not exist
regression=# create database foo;
CREATE DATABASE
regression=# alter database foo set search_path = public,z;
NOTICE:  schema "z" does not exist
ALTER DATABASE
regression=# select datconfig from pg_database where datname = 'foo';        datconfig
---------------------------{"search_path=public, z"}
(1 row)

If a bogus entry is present in the established search_path value, it's
just ignored (this was true already to handle "$user"):

regression=# \c foo
You are now connected to database "foo".
foo=# show search_path;search_path
-------------public, z
(1 row)

foo=# select current_schemas(true);  current_schemas
---------------------{pg_catalog,public}
(1 row)
        regards, tom lane


pgsql-hackers by date:

Previous
From: Andrew Sullivan
Date:
Subject: Re: What's planned for 7.5?
Next
From: Lamar Owen
Date:
Subject: Old binary packages.