Cannot open connection after connecting to Postgres 15 using Navicat Premium

169 阅读2分钟

原文: Postgres 15 removed datlastsysoid field from pg_database table, so any version prior to Navicat 15.0.29 or 16.1 will raise this error while looking for this deprecated field.

To fix this, either upgrade to the latest Navicat 15.0.29 or 16.1 and up (might require new license), or do this:

  1. Exit Navcat.
  2. Open Navicat folder (usually under C:\Program Files\PremiumSoft\Navicat....), depends on your Navicat edition
  3. Locate libcc.dll and create a backup of this file (copy and paste it as "libcc-backup.dll" or any other name)
  4. Open this file in any HEX editor, you can use online tool such as hexed.it/ if you want.
  5. Search for "SELECT DISTINCT datlastsysoid" in the file, and replace it with "SELECT DISTINCT dattablespace"
  6. Save the file in the original location. If you get any security issues, save it as ".txt" file, and then rename it to ".dll"
  7. That's it! Navicat now works as before. If you have ESET or other security tools, the dll file might be locked for few minutes, for security checkup. Be patient, and try after ~5 min again...

stackoverflow原文: here

中文翻译 Postgres 15从pg_database表中删除了 datlastsysoid字段,因此 Navicat 15.0.29 或 16.1 之前的任何版本在查找这个弃用的字段时都会引发此错误。**

要解决此问题,请升级到最新的 Navicat 15.0.29 或 16.1 及更高版本(可能需要新的许可证),或者执行以下操作:

  1. 退出 Navcat。
  2. 打开 Navicat 文件夹(通常在 C:\Program Files\PremiumSoft\Navicat... 下),取决于你的 Navicat 版本
  3. 找到 libcc.dll 并创建该文件的备份(将其复制并粘贴为“libcc-backup.dll”或任何其他名称)
  4. 在任何 HEX 编辑器中打开此文件,如果需要,您可以使用在线工具,例如hexed.it/ 。
  5. 在文件中搜索“SELECT DISTINCT datlastsysoid”,并将其替换为“SELECT DISTINCT dattablespace”
  6. 将文件保存在原始位置。如果遇到任何安全问题,请将其保存为“.txt”文件,然后将其重命名为“.dll”
  7. 就是这样!Navicat 现在可以像以前一样工作了。如果您有 ESET 或其他安全工具,dll 文件可能会被锁定几分钟,以进行安全检查。请耐心等待,大约 5 分钟后再试一次...