From 63b0b4c6b779f11f9e49d1ac4ca51b0096dadc30 Mon Sep 17 00:00:00 2001 From: Sergei Morozov Date: Thu, 22 Sep 2022 07:10:46 -0700 Subject: [PATCH] Do not list tables required by extensions --- src/Schema/PostgreSQLSchemaManager.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/Schema/PostgreSQLSchemaManager.php b/src/Schema/PostgreSQLSchemaManager.php index 4040bf77ce9..53b5c0b6a4d 100644 --- a/src/Schema/PostgreSQLSchemaManager.php +++ b/src/Schema/PostgreSQLSchemaManager.php @@ -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';