使 Postgres SQL 最小化。如何?

发布于 2024-09-06 03:23:53 字数 113 浏览 4 评论 0原文

我想将 Postgres 削减到最小大小,以便在我的应用程序中仅包含数据库功能。我正在使用在互联网上找到的便携式 Postgres。 有什么建议我可以从 Postgres 安装中删除正常数据库使用不需要的内容吗?

I want to cut Postgres to its minimal size for purpose of including just database function with my application. I'm using Portable Postgres found on internet.
Any suggestions what I can delete from Postgres installation which is not needed for normal database use?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

幻梦 2024-09-13 03:23:53

您可以删除 /bin 中的所有独立工具 - 这一切都可以通过 psql 完成。保留以 pg_、postgres 和 initdb 开头的任何内容。

您可能可以删除 lib/ (some_and_some.so)文件中的一堆转换,但可能要等到 initdb'ed 之后才能删除。并且要小心,不要删除您将在某个时刻使用的文件 - 它们是动态加载的,因此您不会注意到,例如,直到客户端使用不同的编码进行连接。

但请注意,这可能不会给你带来太多 - 在我的启用了调试等的系统上,二进制文件需要 17Mb。干净的数据目录里面没有任何数据需要33Mb,大约是它的两倍。如果您要能够使用数据库,您将需要它。

You can delete all the standalone tools in /bin - it can all be done with psql. Keep anything that starts wth pg_, postgres and initdb.

You can probably delete a bunch of conversions in lib/ (the some_and_some.so) files, but probably not until after you've initdb'ed. And be careful not to delete one you'll be using at some point - they are dynamically loaded so you won't notice until a client connects with a different encoding for example.

But note that this probably won't get you much - on my system with debug enabled etc, the binaries take 17Mb. The clean data directory with no data at all in it takes 33Mb, about twice as much. Which you will need if you're going to be able to use your database..

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文