Skip to content

Commit f0663fd

Browse files
committed
#714 Remove duplicates return by PostgreSQL
1 parent a9b6269 commit f0663fd

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Generator/Readers/PostgreSqlDatabaseReader.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ public PostgreSqlDatabaseReader(DbProviderFactory factory, IDatabaseToPropertyTy
2020
protected override string TableSQL()
2121
{
2222
return @"
23-
SELECT T.TABLE_SCHEMA AS ""SchemaName"",
23+
SELECT DISTINCT
24+
T.TABLE_SCHEMA AS ""SchemaName"",
2425
T.TABLE_NAME AS ""TableName"",
2526
T.TABLE_TYPE AS ""TableType"",
2627
CAST(0 AS SMALLINT) AS ""TableTemporalType"",
@@ -66,7 +67,7 @@ AND LOWER(tcfk.CONSTRAINT_TYPE) = 'foreign key'
6667
WHERE (LOWER(T.TABLE_TYPE) = 'base table' OR LOWER(T.TABLE_TYPE) = 'view')
6768
AND (LOWER(T.TABLE_SCHEMA) NOT IN ('pg_catalog', 'information_schema'))
6869
AND (LOWER(T.TABLE_NAME) NOT IN ('edmmetadata', '__migrationhistory', '__efmigrationshistory', '__refactorlog'))
69-
ORDER BY C.TABLE_NAME, C.COLUMN_NAME, C.ORDINAL_POSITION;";
70+
ORDER BY T.TABLE_NAME, C.COLUMN_NAME, C.ORDINAL_POSITION;";
7071
}
7172

7273
protected override string ForeignKeySQL()

0 commit comments

Comments
 (0)