Recent

Author Topic: Postgresql woes  (Read 441 times)

Trenatos

  • Hero Member
  • *****
  • Posts: 524
    • MarcusFernstrom.com
Postgresql woes
« on: August 06, 2020, 08:38:52 am »
I've just installed Postgresql 12 on my Windows 10 dev machine, but I can't get my program to recognize the driver.

When I place it in the same directory as the executable, I get
Code: Pascal  [Select][+][-]
  1. Can not load PostgreSQL client library "libpq.dll"

When I try to use the SQLDBLibraryLoader and specify the path I get the same message.

I used Stack Builder to get the x64 driver.

Anyone else run into this issue?
« Last Edit: August 06, 2020, 06:09:25 pm by Trenatos »

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 8715
  • FPC developer.
Re: Postgresql woes
« Reply #1 on: August 06, 2020, 09:18:58 am »
So... do you generate a 64-bit EXE ? 

MarkMLl

  • Hero Member
  • *****
  • Posts: 1217
Re: Postgresql woes
« Reply #2 on: August 06, 2020, 11:36:03 am »
Is libpq.dll on the system? Does the variant of PostgreSQL you installed include psql, and does it run?

MarkMLl
Turbo Pascal v1 on CCP/M-86, multitasking with LAN and graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 8715
  • FPC developer.
Re: Postgresql woes
« Reply #3 on: August 06, 2020, 11:57:59 am »
And note that the client (pqsql.dll) doesn't have to match the server in 32/64-bit bitness.

But the dll must match the generated application 32/64-bit status.

korba812

  • Full Member
  • ***
  • Posts: 134
Re: Postgresql woes
« Reply #4 on: August 06, 2020, 12:32:36 pm »
Another note is that libpq.dll may depend on other libraries (in my case libcurl.dll, libeay32.dll, libiconv.dll, libintl.dll, libpq.dll, libxml2.dll, libxslt.dll ,ssleay32.dll, zlib1.dll)

MarkMLl

  • Hero Member
  • *****
  • Posts: 1217
Re: Postgresql woes
« Reply #5 on: August 06, 2020, 03:07:09 pm »
And yet another note is that on at least some platforms, you might need to state explicitly where the dynamic libraries may be found.

I mention that since even if it doesn't apply to current Windows, if we're talking about this problem we might as well be complete for the next time Google decides to turn up an unexpected reference :-)

MarkMLl
Turbo Pascal v1 on CCP/M-86, multitasking with LAN and graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.

Trenatos

  • Hero Member
  • *****
  • Posts: 524
    • MarcusFernstrom.com
Re: Postgresql woes
« Reply #6 on: August 06, 2020, 05:28:01 pm »
I'm generating a 64bit exe.

I just made a new gui project, added a button and a TSQLDBLibraryLoader, set the connection type to Postgresql, and the buttons click handler sets enabled to true.

When I start the program I immediately get an error "Invalid connection type:'PostgreSQL'" (Before the form is even visible)

Trenatos

  • Hero Member
  • *****
  • Posts: 524
    • MarcusFernstrom.com
Re: Postgresql woes
« Reply #7 on: August 06, 2020, 06:09:17 pm »
I DID get it working using ZeosDB, so that's good. But could not get it working with the Lazarus bundled functionality.

 

TinyPortal © 2005-2018