aboutsummaryrefslogtreecommitdiff
path: root/doc/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2012-04-11 11:29:22 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2012-04-11 12:02:50 -0400
commit880bfc3287dd68cfe90d10d9597d7b0fd2dae3e5 (patch)
treefc098a016d67756b4841267b50b634c7be695a0b /doc/src
parentb035cb9db7aa7c0f28581b23feb10d3c559701f6 (diff)
downloadpostgresql-880bfc3287dd68cfe90d10d9597d7b0fd2dae3e5.tar.gz
postgresql-880bfc3287dd68cfe90d10d9597d7b0fd2dae3e5.zip
Silently ignore any nonexistent schemas that are listed in search_path.
Previously we attempted to throw an error or at least warning for missing schemas, but this was done inconsistently because of implementation restrictions (in many cases, GUC settings are applied outside transactions so that we can't do system catalog lookups). Furthermore, there were exceptions to the rule even in the beginning, and we'd been poking more and more holes in it as time went on, because it turns out that there are lots of use-cases for having some irrelevant items in a common search_path value. It seems better to just adopt a philosophy similar to what's always been done with Unix PATH settings, wherein nonexistent or unreadable directories are silently ignored. This commit also fixes the documentation to point out that schemas for which the user lacks USAGE privilege are silently ignored. That's always been true but was previously not documented. This is mostly in response to Robert Haas' complaint that 9.1 started to throw errors or warnings for missing schemas in cases where prior releases had not. We won't adopt such a significant behavioral change in a back branch, so something different will be needed in 9.1.
Diffstat (limited to 'doc/src')
-rw-r--r--doc/src/sgml/config.sgml26
1 files changed, 16 insertions, 10 deletions
diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml
index 640defde860..361ad7b99a5 100644
--- a/doc/src/sgml/config.sgml
+++ b/doc/src/sgml/config.sgml
@@ -4670,10 +4670,17 @@ COPY postgres_log FROM '/full/path/to/logfile.csv' WITH csv;
<para>
The value for <varname>search_path</varname> must be a comma-separated
- list of schema names. If one of the list items is
- the special value <literal>$user</literal>, then the schema
- having the name returned by <function>SESSION_USER</> is substituted, if there
- is such a schema. (If not, <literal>$user</literal> is ignored.)
+ list of schema names. Any name that is not an existing schema, or is
+ a schema for which the user does not have <literal>USAGE</>
+ permission, is silently ignored.
+ </para>
+
+ <para>
+ If one of the list items is the special name
+ <literal>$user</literal>, then the schema having the name returned by
+ <function>SESSION_USER</> is substituted, if there is such a schema
+ and the user has <literal>USAGE</> permission for it.
+ (If not, <literal>$user</literal> is ignored.)
</para>
<para>
@@ -4697,16 +4704,15 @@ COPY postgres_log FROM '/full/path/to/logfile.csv' WITH csv;
<para>
When objects are created without specifying a particular target
- schema, they will be placed in the first schema listed
- in the search path. An error is reported if the search path is
- empty.
+ schema, they will be placed in the first valid schema named in
+ <varname>search_path</varname>. An error is reported if the search
+ path is empty.
</para>
<para>
The default value for this parameter is
- <literal>'"$user", public'</literal> (where the second part will be
- ignored if there is no schema named <literal>public</>).
- This supports shared use of a database (where no users
+ <literal>"$user", public</literal>.
+ This setting supports shared use of a database (where no users
have private schemas, and all share use of <literal>public</>),
private per-user schemas, and combinations of these. Other
effects can be obtained by altering the default search path