Hello,
I'm using npqsql.dll to connect to a PostgreSQL 9.4 database. After upgrading npqsql to 3.0.3 (and upgrading my assemblies to .Net 4.5), an InvalidCastException is thrown in C:\Program Files (x86)\DevExpress 14.2\Components\Sources\DevExpress.Xpo\DevExpress.Xpo\Providers\PostgreSQL.cs on line 454
C#public override ICollection CollectTablesToCreate(ICollection tables) {
Dictionary dbTables = new Dictionary();
Dictionary dbSchemaTables = new Dictionary();
string queryString = @"select c.relname, c.relkind, n.nspname from pg_class c
join pg_namespace n on c.relnamespace = n.oid
where c.relname in({0}) and (c.relkind = 'r' OR c.relkind = 'v')";
foreach (SelectStatementResultRow row in GetDataForTables(tables, null, queryString).Rows) {
if (row.Values[0] is DBNull) continue;
string tableName = (string)row.Values[0];
bool isView = (string)row.Values[1] == "v";
string tableSchemaName = (string)row.Values[2];
dbTables[tableName] = isView;
dbSchemaTables.Add(string.Concat(tableSchemaName, ".", tableName), isView);
}
The line
C#bool isView = (string)row.Values[1] == "v";
is causing the exception since row.Values[1] is a char.
Regards,
Jan v/d Broek
Thank you for the report. We have reproduced the issue and are working on the fix.