额外使用NPGSQL和PostgreSQL数据库插入石英表Bytea列

发布于 2025-01-17 17:41:34 字数 648 浏览 2 评论 0原文

使用 Npgsql v1.0.0/4.1.5 提供程序从 WPF 应用程序(C# 和 nhibernate)将数据插入 PostgreSQL (PG) 数据库(版本 11)时,数据以不正确的格式保存在“bytea”类型列中PG 数据库。为了进行故障排除,只是为了查看插入的数据,我们将 bytea 列转换为文本类型,并且我们观察到在我们不想要的数据中引入了额外的双反斜杠。我们想要确定插入的错误格式的根本原因以及如何纠正它。

错误 1:无法检索作业:输入流不是有效的二进制格式。起始内容(以字节为单位)为:5C-30-30-30-31-30-30-30-30-30-30-66-66-66-66-66-66 ... 错误2:无法检索作业:目标数组不够长。检查 destIndex 和长度,以及数组的下限。

需要支持:需要帮助来识别有问题的 dll 或查明依赖关系问题,并通过对应用程序进行微小更改来使 Quartz 实现正常工作。

应用程序中使用的组件:

  1. Castle.windsor 2.5.2
  2. Dotconnect for PostgreSQL
  3. Quartz 1.0.3
  4. WPF
  5. Npgsql 4.1.5
  6. .Net Framework 4.6.1
  7. PostgreSQL 11

When inserting data into PostgreSQL (PG) database (version 11), from a WPF application (C# and nhibernate) using Npgsql v1.0.0/4.1.5 provider, data is getting saved in an incorrect format in the ‘bytea’ type column of the PG database. For troubleshooting purpose, just to see what data is getting inserted, we converted the bytea column to text type, and we observed that there are additional double back slashes that are getting introduced in within data which we do not want. We want to identify the root cause of this incorrect format that is being inserted and how to correct it.

Error1: Couldn't retrieve job: The input stream is not a valid binary format. The starting contents (in bytes) are: 5C-30-30-30-31-30-30-30-30-30-30-66-66-66-66-66-66 ...
Error2: Couldn't retrieve job: Destination array was not long enough. Check destIndex and length, and the array's lower bounds.

Support Needed: need help in identifying the problematic dll or pinpoint the dependency issue and to get the Quartz implementation working with minor changes to the application.

Components used in the application:

  1. Castle.windsor 2.5.2
  2. Dotconnect for PostgreSQL
  3. Quartz 1.0.3
  4. WPF
  5. Npgsql 4.1.5
  6. .Net Framework 4.6.1
  7. PostgreSQL 11

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文