Skip to content

Commit

Permalink
Merge pull request #5687 from morozov/issues/5668
Browse files Browse the repository at this point in the history
Do not list tables required by extensions
  • Loading branch information
morozov committed Sep 22, 2022
2 parents 85c62c4 + 63b0b4c commit a0bd0f1
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/Schema/PostgreSQLSchemaManager.php
Expand Up @@ -632,15 +632,22 @@ protected function selectTableColumns(string $databaseName, ?string $tableName =
(SELECT pg_description.description
FROM pg_description WHERE pg_description.objoid = c.oid AND a.attnum = pg_description.objsubid
) AS comment
FROM pg_attribute a, pg_class c, pg_type t, pg_namespace n
FROM pg_attribute a
INNER JOIN pg_class c
ON c.oid = a.attrelid
INNER JOIN pg_type t
ON t.oid = a.atttypid
INNER JOIN pg_namespace n
ON n.oid = c.relnamespace
LEFT JOIN pg_depend d
ON d.objid = c.oid
AND d.deptype = 'e'
SQL;

$conditions = array_merge([
'a.attnum > 0',
'a.attrelid = c.oid',
'a.atttypid = t.oid',
'n.oid = c.relnamespace',
"c.relkind = 'r'",
'd.refobjid IS NULL',
], $this->buildQueryConditions($tableName));

$sql .= ' WHERE ' . implode(' AND ', $conditions) . ' ORDER BY a.attnum';
Expand Down

0 comments on commit a0bd0f1

Please sign in to comment.