How do I connect to an external database and specify the schema to use? I want to connect Drupal to an external Database and I need to specify the schema on the settings.php file, otherwise Drupal schema module connects by default to the 'public' schema. I tried, without success, with the following code.

 $databases['conservation']['default'] = array(
   'database' =&gt; 'conservation',
   'schema' =&gt; 'projects_test1',
    'username' =&gt; 'xxxxxxxxxxx',
    'password' =&gt; 'xxx',
    'host' =&gt; 'xxx.xxx.xxx',
    'port' =&gt; '5432',
    'driver' =&gt; 'pgsql',
    'prefix' =&gt; array(
      'default'   =&gt; 'projects_test1.',
      'users'     =&gt; 'shared.',
      'sessions'  =&gt; 'shared.',
      'role'      =&gt; 'shared.',
      'authmap'   =&gt; 'shared.',
    )
  );


I have done some googling, but I haven't found anybody trying to do this.
You can specify a PGSQL schema using the prefix setting in settings.php

 * You can also use a reference to a schema/database as a prefix. This may be
 * useful if your Drupal installation exists in a schema that is not the default
 * or you want to access several databases from the same code base at the same
 * time.
 * Example:
 *   'prefix' =&gt; array(
 *     'default'   =&gt; 'main.',
 *     'users'     =&gt; 'shared.',
 *     'sessions'  =&gt; 'shared.',
 *     'role'      =&gt; 'shared.',
 *     'authmap'   =&gt; 'shared.',
 *   );


More info: https://api.drupal.org/api/drupal/sites%21default%21default.settings.php/7 > "View Source"

If that's not working for you, make sure the rest of the database connection details are correct. (e.g you're using 'shared.' presumably that schema also exists)