Re: compact PostgreSQL

From: Christopher Browne <cbbrowne(at)acm(dot)org>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: compact PostgreSQL
Date: 2004-10-09 14:31:22
Message-ID: m3mzyw2cat.fsf@wolfe.cbbrowne.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

In the last exciting episode, yui(at)mariana(dot)u-aizu(dot)ac(dot)jp (Yui Hiroaki) wrote:
> I would like to install PostgreSQL. But my pc does not have much
> space. So I would like to make compact PostgreSQL. Does anyone know
> how to make compact PostgreSQL? For example, to make comment out
> source code and compile.

Commenting things out isn't likely to help terribly much. In order to
be able to compile PostgreSQL in the first place, you'll need enough
disk space for:

a) All of the source code;
b) All of the object code (in .o form);
c) All of the compiled binaries.

Supposing you find a way to make the compiled binaries somewhat
smaller, you will still have to store all the source code and all of
the "raw" object code, which will be considerably larger than the
compiled binaries.

The only way to "save space" is to get someone else to compile
PostgreSQL, and install a precompiled version, in which manner you'll
avoid having a) and b) around.

Supposing you can assure yourself that you will not be using certain
components that are stored in their own libraries or binary programs,
you may be able to delete them from the compiled binaries.

For instance, if you are certain you will never need to use stored
functions in PL/pgsql, you might delete the library for that.
Likewise, libraries for PL/Perl and PL/Python may get installed and be
unnecessary for you.

If you are certain that you will only use certain locales, then there
are some libraries you might be able to drop from the following set:

knuth:~# wc -c `dpkg -L postgresql | grep utf8`
5280 /usr/lib/postgresql/lib/utf8_and_ascii.so
225720 /usr/lib/postgresql/lib/utf8_and_big5.so
12808 /usr/lib/postgresql/lib/utf8_and_cyrillic.so
125536 /usr/lib/postgresql/lib/utf8_and_euc_cn.so
217392 /usr/lib/postgresql/lib/utf8_and_euc_jp.so
137976 /usr/lib/postgresql/lib/utf8_and_euc_kr.so
336688 /usr/lib/postgresql/lib/utf8_and_euc_tw.so
1020152 /usr/lib/postgresql/lib/utf8_and_gb18030.so
355064 /usr/lib/postgresql/lib/utf8_and_gbk.so
32528 /usr/lib/postgresql/lib/utf8_and_iso8859.so
6448 /usr/lib/postgresql/lib/utf8_and_iso8859_1.so
279144 /usr/lib/postgresql/lib/utf8_and_johab.so
127880 /usr/lib/postgresql/lib/utf8_and_sjis.so
8376 /usr/lib/postgresql/lib/utf8_and_tcvn.so
279160 /usr/lib/postgresql/lib/utf8_and_uhc.so
8408 /usr/lib/postgresql/lib/utf8_and_win1250.so
8440 /usr/lib/postgresql/lib/utf8_and_win1256.so
8216 /usr/lib/postgresql/lib/utf8_and_win874.so
3195216 total

Similarly, there are likely irrelevant locale-specific message files
that may be dropped. Look for LC_MESSAGES; there's about 2.4MB of
language-specific messages on my system, and most of them I am
unlikely ever to use since they are messages for languages I do not
know (e.g. - Spanish, Italian, Portuguese, Russian, Asian languages).
--
wm(X,Y):-write(X),write('@'),write(Y). wm('cbbrowne','ntlug.org').
http://linuxfinances.info/info/spreadsheets.html
Faith is the quality that enables you to eat blackberry jam on a
picnic without looking to see whether the seeds move. -- DeMara Cabrera

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2004-10-09 14:52:59 Re: SSL with Beta3 - "could not load root certificate file"
Previous Message ohp 2004-10-09 14:13:09 beta3 on unixware 714