如何在Windows上仅安装PostgreSQL的客户端工具? [英] How do I install just the client tools for PostgreSQL on Windows?
问题描述
我要在Windows PC上访问Linux系统上的PostgreSQL数据库。但是我唯一能找到的Windows二进制文件是完整的安装程序,其中包括数据库服务器和客户端。
是否有可能获得仅客户端的Windows二进制文件是否可以从任何地方安装PostgreSQL?
(为澄清起见,我需要标准的PostgreSQL客户端psql-不是GUI客户端或独立工具)。
不幸的是,没有真正的客户端仅安装程序。
您可以做的是下载完整的Postgres二进制文件的ZIP存档:
http://www.enterprisedb.com/products-services-training/pgbindownload
,然后从其中删除服务器部分。
解压缩后,会得到以下目录:
bin
doc
include
lib
pgAdmin III
share
StackBuilder
符号
您可以删除 doc
,包括
, pgAdmin III
, StackBuilder
和符号
目录。据我所知(但我不确定),客户端也不需要 share
或 lib
目录,但您需要对此进行测试。这样就只剩下 bin
目录。
我认为份额
psql 中的本地化错误消息可能需要$ c>目录,但是我不确定。
在 bin
目录中,您实际上可以删除所有.exe文件(当然,除了 psql.exe
以外)。您也可以删除所有 wx * .dll
文件,这些文件仅用于pgAdmin。服务器也只需要 libxml2.dll
和 libxslt.dll
。
如果您确实需要其他一些客户端工具,则可能需要保留
- pg_dump.exe
- pg_dumpall.exe
- pg_restore.exe
一个这种方法的缺点是,这需要安装Visual C ++ Redistributable。但是您也可以通过简单地将安装在其上的计算机中的 MSVCR120.DLL
放入 bin
来克服该问题。目录。
因此,您将获得psql客户端所需的以下文件(来自 bin
目录): / p>
- iconv.dll
- libeay32.dll
- libintl -8.dll
- libpq.dll
- msvcr120.dll
- ssleay32.dll
- zlib1.dll
- psql.exe
当然还可以从现有的Postgres安装中获取所有内容,而无需下载ZIP存档。
真正的安装程序,但是如果将清理后的目录放入ZIP文件中,则可以分发该目录,而需要它的人只需解压缩存档即可。我个人认为 unzip
仍然是最好的安装程序(我也用它来安装Postgres服务器,Windows安装程序有太多怪癖)
I have a PostgreSQL database on a Linux system that I want to access from my Windows PC. But the only Windows binaries I have been able to find are the full installer, which includes the database server and client.
Is it possible to get a client-only Windows binary install for PostgreSQL from anywhere?
(To clarify, I want the standard PostgreSQL client, psql - not a GUI client or independent tool).
Unfortunately there is no real client "only" installer.
What you can do, is to download the ZIP archive of the complete Postgres binaries:
http://www.enterprisedb.com/products-services-training/pgbindownload
and then remove the "server" part from it.
When you unzip it, you get the following directories:
bin doc include lib pgAdmin III share StackBuilder symbols
You can remove the doc
, include
, pgAdmin III
, StackBuilder
and symbols
directories. As far as I can tell (but I am not sure) the client also doesn't need the share
or lib
directories, but you would need to test that. So that leaves only the bin
directory.
I think the share
directory could be needed for localized error messages in psql
but I'm not sure about that.
Inside the bin
directory you can essentially remove all .exe files (except psql.exe
of course). You can also remove all wx*.dll
files, they are only needed for pgAdmin. The libxml2.dll
and libxslt.dll
are also only needed for the server.
If you do want some of the other client tools, you might want to keep
- pg_dump.exe
- pg_dumpall.exe
- pg_restore.exe
One drawback of this approach is that this requires the Visual C++ Redistributable to be installed. But you can overcome that as well by simply putting the MSVCR120.DLL
from some computer where it is installed into the bin
directory.
So that leaves you with these files (from the bin
directory) that are required for the psql client:
- iconv.dll
- libeay32.dll
- libintl-8.dll
- libpq.dll
- msvcr120.dll
- ssleay32.dll
- zlib1.dll
- psql.exe
Of course you can also take all that from an existing Postgres installation without the need to download the ZIP archive.
It is obviously not a real installer, but if you put the cleaned up directory into a ZIP file, you can distribute that and whoever needs it just unzips the archive. Personally I find unzip
to be the best "installer" anyway (I also use that to install the Postgres server, the Windows installer just has too many quirks)
这篇关于如何在Windows上仅安装PostgreSQL的客户端工具?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!