[solved] Connection to Postgres failed.

The offical for ZeosLib 7.3 Report problems, ask for help, post proposals for the new version of Zeoslib 7.3/v8
Quick Info:
-We made two new drivers: odbc(raw and unicode version) and oledb
-GUID domain/field-defined support for FB
-extended error infos of Firebird
-performance ups are still in queue
In future some more feature will arrive, so stay tuned and don't hassitate to help
Post Reply
Michl
Fresh Boarder
Fresh Boarder
Posts: 13
Joined: 01.04.2014, 12:53

[solved] Connection to Postgres failed.

Post by Michl »

Hi,

hope it's not a FAQ, but I don't found a answer yet.

I already asked in German Lazarusforum: https://www.lazarusforum.de/viewtopic.php?f=17&t=13323

I've tried to update a project with a newer Zeos.

In a minimal example I try following:

Code: Select all

procedure TForm1.FormCreate(Sender: TObject);
begin
  FZConnection := TZConnection.Create(Self);
  FZConnection.Database        := ###;
  FZConnection.LibraryLocation := 'C:\Program Files\PostgreSQL\10\bin\libpq.dll';
  FZConnection.Password        := ###';
  FZConnection.Properties.Text := 'Undefined_Varchar_AsString_Length=255';
  FZConnection.Protocol        := 'postgresql-9';
  FZConnection.User            := ###;
  FZConnection.Connect;
end;
Testing with Zeos Trunk, old versions are running, after revision 4474 libpq.dll isn't found anymore:
None of the dynamic libraries can be found or is not loadable: libpq.dll! Use TZConnection.LibraryLocation if the location is invalid.
What I am missing? Thank you
Last edited by Michl on 30.12.2020, 13:51, edited 1 time in total.
marsupilami
Platinum Boarder
Platinum Boarder
Posts: 1956
Joined: 17.01.2011, 14:17

Re: Connection to Postgres failed.

Post by marsupilami »

Hello Michl,

postgresql-9 isn't a valid protocol anymore on Zeos 8.0. What happens if you use 'postgresql'? Or are you on Zeos 7.2?

Best regards,

Jan
Michl
Fresh Boarder
Fresh Boarder
Posts: 13
Joined: 01.04.2014, 12:53

Re: Connection to Postgres failed.

Post by Michl »

Yeah cool! That's it. Thank you very much! Now it is working again.
Post Reply