Commit 5b284995 authored by Benjamin Eberlei's avatar Benjamin Eberlei

Merge branch 'DBAL-244' into 2.2

parents 66b30b20 9c8ee01f
......@@ -43,7 +43,7 @@ class PostgreSqlSchemaManager extends AbstractSchemaManager
*/
public function getSchemaNames()
{
$rows = $this->_conn->fetchAll('SELECT schema_name FROM information_schema.schemata');
$rows = $this->_conn->fetchAll("SELECT nspname as schema_name FROM pg_namespace WHERE nspname !~ '^pg_.*' and nspname != 'information_schema'");
return array_map(function($v) { return $v['schema_name']; }, $rows);
}
......
......@@ -13,8 +13,14 @@ class PostgreSqlSchemaManagerTest extends SchemaManagerFunctionalTestCase
public function tearDown()
{
parent::tearDown();
if (!$this->_conn) {
return;
}
$this->_conn->getConfiguration()->setFilterSchemaAssetsExpression(null);
}
/**
* @group DBAL-177
*/
......@@ -26,6 +32,18 @@ class PostgreSqlSchemaManagerTest extends SchemaManagerFunctionalTestCase
$this->assertEquals(array($params['user'], 'public'), $paths);
}
/**
* @group DBAL-244
*/
public function testGetSchemaNames()
{
$names = $this->_sm->getSchemaNames();
$this->assertInternalType('array', $names);
$this->assertTrue(count($names) > 0);
$this->assertTrue(in_array('public', $names), "The public schema should be found.");
}
/**
* @group DBAL-21
*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment