--- /dev/null
+Description: Fix to treating Bacula PostgreSQL tables names as lowercase characters.
+Author: Marcin Haba <marcin.haba@bacula.pl>
+--- framework.orig/Data/ActiveRecord/TActiveRecordGateway.php 2014-08-26 16:45:36.000000000 +0200
++++ framework/Data/ActiveRecord/TActiveRecordGateway.php 2015-02-08 20:55:43.000000000 +0100
+@@ -100,9 +100,15 @@ class TActiveRecordGateway extends TComp
+ public function getTableInfo(TDbConnection $connection, $tableName)
+ {
+ $connStr = $connection->getConnectionString();
++ $connection->setActive(true);
++ $driver = $connection->getDriverName();
++ if($driver == 'pgsql') {
++ $tableName = strtolower($tableName);
++ }
+ $key = $connStr.$tableName;
+ if(!isset($this->_tables[$key]))
+ {
++
+ //call this first to ensure that unserializing the cache
+ //will find the correct driver dependent classes.
+ if(!isset($this->_meta[$connStr]))