Cannot open connection after connecting to Postgres 15 using Navicat Premium
Asked Answered
E

4

14

I've encountered into a connection issue between PostgreSQL 15 and Navicat 15.

My environment is:

  • Windows 10
  • PostgreSQL 15
  • Navicat Premium 15.0.16 (Activated)

How to produce:

  • Open 'New Connection' dialog. (Files -> New Connection -> PostgreSQL...)
  • Put information in fields.
  • Check if 'Test Connection' works. (It works on my end as well.)
  • Click 'OK'
  • In the list of connections, double-click the connection.

Expected:
Should be able to open the connection.

Actual:
It says the following message on an error dialog.

ERROR: column "datlastsysoid" does not exist
LINE 1: SELECT DISTINCT datlastsysoid FROM pg_database
Exceptionable answered 12/12, 2022 at 15:41 Comment(1)
The column is gone, but it's not documented in the release notes... Ask Navicat how to deal with thisWinniewinnifred
B
31

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 https://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...

Enjoy!

Bitters answered 30/4, 2023 at 9:51 Comment(6)
Thanks! It worked. The hexed.it didn't work for me, had too many security issues, so I downloaded this (free) hhdsoftware.com/free-hex-editor and changed datlastsysoid to dattablespace in 3 placesNeil
Wow. That fixed it. How the heck did you know that was the solution?Harvison
For any PremiumSoft employees passing by this way, slap yourself around the face for providing such an awful level of support for a "lifetime" purchase.Foreordain
you can allways keep two versions of library (for postgres <= 14, and new edited for >= postgres 15 nd up. Very nice solutionTransportation
Any ideas how to do this steps on Mac OS?Unscrew
@Unscrew edit libcc-premium.dylib file in contents folder the same as Windows, and use codesign re-sign the new file, i attached the full answer on this questionBreebreech
S
7

The error goes away if you upgrade to latest Navicat version. Version 16.1.5 definitely fixes this issue.

Soldierly answered 30/12, 2022 at 20:2 Comment(0)
I
2

I had the same problem because they used navicat 15, but as soon as I changed to version 16 that error disappeared. Change version and that's it!

Imperialism answered 20/11, 2023 at 22:22 Comment(0)
B
1

To supplement the manual fix on macOS, follow these steps:

  1. Open the Navicat application folder and navigate to Contents -> Frameworks.
  2. Locate the file libcc-premium.dylib and create a backup named libcc-premium.dylib.old.
  3. Open the file libcc-premium.dylib with a HEX editor (you can use an online tool such as https://hexed.it/).
  4. Replace datlastsysoid with dattablespace, hex code is 6461747461626c657370616365.
  5. Save the modified file as libcc-premium.dylib and place it back in the original folder.
  6. Use codesign to re-sign the file, otherwise, you won't be able to open the application. Use the following command to sign the file:
    codesign --deep --force --verify --verbose --sign - libcc-premium.dylib
    
  7. After re-signing, open the application, and you should be able to connect successfully.

replace datlastsysoid with dattablespace as shown in the image below.

dattablespace hex code is 6461747461626c657370616365

Breebreech answered 11/7 at 7:7 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.