Dear friends,
I am a newcomer on Drupal mailing list
and I would like to thank you all for developing this great tool.
I would like to integrate Drupal with existing web services.
Our database is running PostgreSQL 8.2+
PostgreSQL has a neat feature called schema.
A schema is some kind of logical partition in a database.
It is a more powerfull feature than table_prefix as it is more general and built-in.
In database.pgsql.inc, here is what I modified:
if (isset($url['port'])) {
$conn_string .= ' port='. urldecode($url['port']);
}
$schema='';
if (isset($url['schema'])) {
$schema .= urldecode($url['schema']);
}
// pg_last_error() does not return a useful error message for database
// connection errors. We must turn on error tracking to get at a good error
// message, which will be stored in $php_errormsg.
$track_errors_previous = ini_get('track_errors');
ini_set('track_errors', 1);
//$schema='drupal';
if ($schema !== '')
{
@pg_query($this->db_connect_id, 'SET search_path TO ' . $schema);
}
$connection = @pg_connect($conn_string);
if (!$connection) {
require_once './includes/unicode.inc';
_db_error_page(decode_entities($php_errormsg));
}
I think it is a valuable addition, as it has zero impact on the existing code.