How to remove trailing spaces and change encoding in char(n) columns in dynamic ExecuteQuery
- 阅读更多 关于 How to remove trailing spaces and change encoding in char(n) columns in dynamic ExecuteQuery
问题 ASP.NET MVC Core 5 application uses Npgsql to get data from Postgres database. Columns in database are defined as CHAR(n) type, like: create table prpalk ( sfirmanimi char(100) ); Column types cannot be changed to varchar. Postgres database encoding is unicode. However some columns are in custom encoding which needs to be converted to unicode to be used in .NET. Those column names in database start always with word Custom. I tried Dapper to get data but data contains trailing spaces and