Skip to content

Commit 6ea5c5d

Browse files
2881028810
authored andcommitted
- 修复 PostgreSQL CodeFirst/DbFirst 系统表的版本兼容问题;
1 parent 1d09b7f commit 6ea5c5d

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

Providers/FreeSql.Provider.Odbc/PostgreSQL/OdbcPostgreSQLCodeFirst.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ protected override string GetComparisonDDLStatements(params TypeAndName[] object
183183
case when t.typelem > 0 and t.typinput::varchar = 'array_in' then t2.typname else t.typname end,
184184
case when a.attnotnull then '0' else '1' end as is_nullable,
185185
--e.adsrc,
186-
(select pg_get_expr(adbin, adrelid) from pg_attrdef where adrelid = e.adrelid) is_identity,
186+
(select pg_get_expr(adbin, adrelid) from pg_attrdef where adrelid = e.adrelid limit 1) is_identity,
187187
a.attndims,
188188
d.description as comment
189189
from pg_class c

Providers/FreeSql.Provider.Odbc/PostgreSQL/OdbcPostgreSQLDbFirst.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ where b.nspname not in ('pg_catalog', 'information_schema') and a.relkind in ('m
210210
case when t.typelem = 0 then t.typname else t2.typname end,
211211
case when a.attnotnull then 0 else 1 end as is_nullable,
212212
--e.adsrc as is_identity, pg12以下
213-
(select pg_get_expr(adbin, adrelid) from pg_attrdef where adrelid = e.adrelid) is_identity,
213+
(select pg_get_expr(adbin, adrelid) from pg_attrdef where adrelid = e.adrelid limit 1) is_identity,
214214
d.description as comment,
215215
a.attndims,
216216
case when t.typelem = 0 then t.typtype else t2.typtype end,

Providers/FreeSql.Provider.PostgreSQL/PostgreSQLCodeFirst.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ protected override string GetComparisonDDLStatements(params TypeAndName[] object
218218
case when t.typelem > 0 and t.typinput::varchar = 'array_in' then t2.typname else t.typname end,
219219
case when a.attnotnull then '0' else '1' end as is_nullable,
220220
--e.adsrc,
221-
(select pg_get_expr(adbin, adrelid) from pg_attrdef where adrelid = e.adrelid) is_identity,
221+
(select pg_get_expr(adbin, adrelid) from pg_attrdef where adrelid = e.adrelid limit 1) is_identity,
222222
a.attndims,
223223
d.description as comment
224224
from pg_class c

Providers/FreeSql.Provider.PostgreSQL/PostgreSQLDbFirst.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ where b.nspname not in ('pg_catalog', 'information_schema') and a.relkind in ('m
320320
case when t.typelem = 0 then t.typname else t2.typname end,
321321
case when a.attnotnull then 0 else 1 end as is_nullable,
322322
--e.adsrc as is_identity, pg12以下
323-
(select pg_get_expr(adbin, adrelid) from pg_attrdef where adrelid = e.adrelid) is_identity,
323+
(select pg_get_expr(adbin, adrelid) from pg_attrdef where adrelid = e.adrelid limit 1) is_identity,
324324
d.description as comment,
325325
a.attndims,
326326
case when t.typelem = 0 then t.typtype else t2.typtype end,

0 commit comments

Comments
 (0)