]> granicus.if.org Git - postgresql/commitdiff
Ignore missing schemas during non-interactive assignment of search_path.
authorTom Lane <tgl@sss.pgh.pa.us>
Wed, 11 Apr 2012 16:02:14 +0000 (12:02 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Wed, 11 Apr 2012 16:03:05 +0000 (12:03 -0400)
This aligns 9.1's behavior with that of older branches.  HEAD is now even
laxer, ignoring missing schemas all the time, but that seems like too big
a change for a released branch.  Per complaint from Robert Haas.

src/backend/catalog/namespace.c

index b57c25595fc7ac0f0afb5d2e4a2da20b708db811..15622f8423eb96cfcb0022931c7e08f6cf9593d5 100644 (file)
@@ -3565,8 +3565,10 @@ check_search_path(char **newval, void **extra, GucSource source)
        /*
         * If we aren't inside a transaction, we cannot do database access so
         * cannot verify the individual names.  Must accept the list on faith.
+        * Also, if the value is coming from a noninteractive source, accept it
+        * anyway.
         */
-       if (IsTransactionState())
+       if (IsTransactionState() && source >= PGC_S_INTERACTIVE)
        {
                /*
                 * Verify that all the names are either valid namespace names or