In want to store an array in this field. [Field] public byte[] SerializedTaskPackage { get; private set; } And i get completely wrong array back (double size +1 ) It is a PostgreSQL specific problem, memory provider and sqlserver provider work. I use PostgreSQL 9.0.2 64-bit After some research i found that the delivered data is ASCII encoded with a "\" at the beginning and two ASCII Hex Digits'0'-'9', 'a'-'f' for each byte:
Here is the test code:
|
I have found the reason for this. There is a breaking change in 9.0 concerning bytea fields. In 9.0 they delivered byteea fields in the "hex" format instead of the legacy "escape" format for performance reasons. Workaround for old Npgsql drivers: ALTER DATABASE foo SET bytea_output='escape'; This issue is fixed with the Npgsql2.0.11 driver (2010-11-05) http://pgfoundry.org/frs/shownotes.php?release_id=1727 Please bind and include this driver in the next DO4 release. I think changes in DO4 code are not necessary. Thanks Thomas. Will do. DataObjects.Net 4.3.7 & 4.4 beta 2 with the last version of Npgsqlprovider is released |
Thanks, Thomas. We'll investigate the issue during the upcoming week. Special thanks for the test case. It will definitely help to speed up the process. BTW, have you tried any previous version of PostgreSQL? I mean 8.x family. We haven't run our tests against PostgreSQL 9.0 yet. |