Re: install libpq.dll in bin directory on Windows / Cygwin

From: "MauMau" <maumau307(at)gmail(dot)com>
To: "Andrew Dunstan" <andrew(dot)dunstan(at)pgexperts(dot)com>, "PostgreSQL-development" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: install libpq.dll in bin directory on Windows / Cygwin
Date: 2013-07-25 22:27:10
Message-ID: 10470B394DB8486F93AC60107CC44C8B@maumau
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

From: "Andrew Dunstan" <andrew(dot)dunstan(at)pgexperts(dot)com>
> on Windows it's necessary to have libpq.dll/cygpq.dll either in the PATH
> or in the same directory as client .exe files. The buildfarm client has
> for many years simply copied this dll from the installation lib to the
> installation bin directory after running "make install". But I can't
> really see why we don't do that as part of "make install" anyway. I
> haven't tested but I think something like this patch would achieve this
> goal - it would fix something that's tripped a lot of people up over the
> years.
>
> Comments? If we do this, should it be backported?

I was just about to propose something related to this.

On native Windows (not on Cygwin or MinGW), DLLs are in general placed in
(1) system directory (e.g. c:\windows\system32), (2) somewhere in PATH, or
(3) the same directory as EXEs which automatically load the DLL at
invocation. It's no problem that most DLLs in PostgreSQL's lib directory,
because they are loaded at runtime by postgres.exe by calling LoadLibrary()
specifying an absolute or a relative path. However, the below files are
misplaced:

libecpg.dll
libecpg_compat.dll
libpgtypes.dll

These should be placed in bin directory. If done so, when running SQL
embedded C applications, users can just add bin in PATH, which is usually
done already. Otherwise, users have to add both bin and lib in PATH.
Usually, lib is not added in PATH in many software.

Could you please place the above files in bin and remove them from lib?

BTW, why is libpq.dll in lib necessary? For the above files? If so, we can
remove libpq.dll from lib. Or, libpqwalreceiver.dll needs it?

Regards
MauMau

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2013-07-25 23:24:53 Re: getting rid of SnapshotNow
Previous Message didier 2013-07-25 22:02:48 Re: Design proposal: fsync absorb linear slider