Adding schema support to Postgres driver (Ticket #1623)

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5085 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
nate 2007-05-14 00:15:44 +00:00
parent f742c8f879
commit f7e4594df7

View file

@ -47,6 +47,7 @@ class DboPostgres extends DboSource {
'login' => 'root',
'password' => '',
'database' => 'cake',
'schema' => 'public',
'port' => 5432,
'encoding' => ''
);
@ -126,7 +127,8 @@ class DboPostgres extends DboSource {
return $cache;
}
$sql = "SELECT table_name as name FROM INFORMATION_SCHEMA.tables WHERE table_schema = 'public';";
$schema = $this->config['schema'];
$sql = "SELECT table_name as name FROM INFORMATION_SCHEMA.tables WHERE table_schema = '{$schema}';";
$result = $this->fetchAll($sql);
if (!$result) {