aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/db/postgres.php
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/includes/db/postgres.php')
-rw-r--r--phpBB/includes/db/postgres.php15
1 files changed, 14 insertions, 1 deletions
diff --git a/phpBB/includes/db/postgres.php b/phpBB/includes/db/postgres.php
index 4360c790a1..29e15143bc 100644
--- a/phpBB/includes/db/postgres.php
+++ b/phpBB/includes/db/postgres.php
@@ -81,13 +81,25 @@ class dbal_postgres extends dbal
if ($this->persistency)
{
+ if (!function_exists('pg_pconnect'))
+ {
+ return $this->sql_error('pg_pconnect does not exist');
+ }
+ phpbb_start_error_collection();
$this->db_connect_id = (!$new_link) ? @pg_pconnect($connect_string) : @pg_pconnect($connect_string, PGSQL_CONNECT_FORCE_NEW);
}
else
{
+ if (!function_exists('pg_pconnect'))
+ {
+ return $this->sql_error('pg_connect does not exist');
+ }
+ phpbb_start_error_collection();
$this->db_connect_id = (!$new_link) ? @pg_connect($connect_string) : @pg_connect($connect_string, PGSQL_CONNECT_FORCE_NEW);
}
+ $errors = phpbb_stop_error_collection();
+
if ($this->db_connect_id)
{
if (version_compare($this->sql_server_info(true), '8.2', '>='))
@@ -102,7 +114,8 @@ class dbal_postgres extends dbal
return $this->db_connect_id;
}
- return $this->sql_error('');
+ $errors = phpbb_format_collected_errors($errors);
+ return $this->sql_error($errors);
}
/**