{"id":11576,"date":"2018-08-17T18:20:22","date_gmt":"2018-08-17T16:20:22","guid":{"rendered":"https:\/\/www.dbi-services.com\/blog\/the-size-of-oracle-home-from-9gb-to-600mb-what-about-postgresql\/"},"modified":"2018-08-17T18:20:22","modified_gmt":"2018-08-17T16:20:22","slug":"the-size-of-oracle-home-from-9gb-to-600mb-what-about-postgresql","status":"publish","type":"post","link":"https:\/\/www.dbi-services.com\/blog\/the-size-of-oracle-home-from-9gb-to-600mb-what-about-postgresql\/","title":{"rendered":"The size of Oracle Home: from 9GB to 600MB &#8211; What about PostgreSQL?"},"content":{"rendered":"<p>A <a href=\"https:\/\/www.dbi-services.com\/blog\/the-size-of-oracle-home-from-9gb-to-600mb\/\" target=\"_blank\" rel=\"noopener\">recent blog post from Franck<\/a> and a <a href=\"https:\/\/twitter.com\/FranckPachot\/status\/1030101514134667265\" target=\"_blank\" rel=\"noopener\">tweet around that topic<\/a> is the inspiration for this blog post, thanks <a href=\"https:\/\/twitter.com\/johnnyq72\" target=\"_blank\" rel=\"noopener\">Jan<\/a> for requesting :). In short it is about how small you can get the binaries. Is that important? At least when it comes to Docker images it might get important as you usually try make the image as small as possible. Well, comparing PostgreSQL and Oracle in that field is unfair as Oracle comes with many stuff by default which PostgreSQL is just not shipping (e.g. Apex, SQL Developer, &#8230;), so please treat this more a as fun post, please.<\/p>\n<p><!--more--><\/p>\n<p>The way we usually compile PostgreSQL is this (not in \/var\/tmp in real life):<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">\npostgres@pgbox:\/home\/postgres\/ [pg103] cd \/var\/tmp\/\npostgres@pgbox:\/var\/tmp\/ [pg103] wget https:\/\/ftp.postgresql.org\/pub\/source\/v10.5\/postgresql-10.5.tar.bz2\npostgres@pgbox:\/var\/tmp\/ [pg103] tar -axf postgresql-10.5.tar.bz2\npostgres@pgbox:\/var\/tmp\/ [pg103] cd postgresql-10.5\/\npostgres@pgbox:\/var\/tmp\/postgresql-10.5\/ [pg103] PGHOME=\/var\/tmp\/pg105\npostgres@pgbox:\/var\/tmp\/postgresql-10.5\/ [pg103] SEGSIZE=2\npostgres@pgbox:\/var\/tmp\/postgresql-10.5\/ [pg103] BLOCKSIZE=8\npostgres@pgbox:\/var\/tmp\/postgresql-10.5\/ [pg103] WALSEGSIZE=16\npostgres@pgbox:\/var\/tmp\/postgresql-10.5\/ [pg103] .\/configure --prefix=${PGHOME} \n                                                             --exec-prefix=${PGHOME} \n                                                             --bindir=${PGHOME}\/bin \n                                                             --libdir=${PGHOME}\/lib \n                                                             --sysconfdir=${PGHOME}\/etc \n                                                             --includedir=${PGHOME}\/include \n                                                             --datarootdir=${PGHOME}\/share \n                                                             --datadir=${PGHOME}\/share \n                                                             --with-pgport=5432 \n                                                             --with-perl \n                                                             --with-python \n                                                             --with-openssl \n                                                             --with-pam \n                                                             --with-ldap \n                                                             --with-libxml \n                                                             --with-libxslt \n                                                             --with-segsize=${SEGSIZE} \n                                                             --with-blocksize=${BLOCKSIZE} \n                                                             --with-wal-segsize=${WALSEGSIZE}  \n                                                             --with-systemd\npostgres@pgbox:\/var\/tmp\/postgresql-10.5\/ [pg103] make -j 4 all\npostgres@pgbox:\/var\/tmp\/postgresql-10.5\/ [pg103] make install\npostgres@pgbox:\/var\/tmp\/postgresql-10.5\/ [pg103] cd contrib\npostgres@pgbox:\/var\/tmp\/postgresql-10.5\/ [pg103] make -j 4 install\n<\/pre>\n<p>When we do this against the PostgreSQL 10.5 source code the result is this (without the documentation, of course, but containing all the <a href=\"https:\/\/www.postgresql.org\/docs\/10\/static\/contrib.html\" target=\"_blank\" rel=\"noopener\">extensions<\/a> ):<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">\npostgres@pgbox:\/var\/tmp\/postgresql-10.5\/contrib\/ [pg103] du -sh \/var\/tmp\/pg105\/\n28M\t\/var\/tmp\/pg105\/\n<\/pre>\n<p>Can we get that even smaller? Let&#8217;s try to skip the extensions:<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">\npostgres@pgbox:\/var\/tmp\/postgresql-10.5\/contrib\/ [pg103] cd ..\npostgres@pgbox:\/var\/tmp\/postgresql-10.5\/ [pg103] make clean\npostgres@pgbox:\/var\/tmp\/postgresql-10.5\/ [pg103] .\/configure --prefix=${PGHOME} \n                                                             --exec-prefix=${PGHOME} \n                                                             --bindir=${PGHOME}\/bin \n                                                             --libdir=${PGHOME}\/lib \n                                                             --sysconfdir=${PGHOME}\/etc \n                                                             --includedir=${PGHOME}\/include \n                                                             --datarootdir=${PGHOME}\/share \n                                                             --datadir=${PGHOME}\/share \n                                                             --with-pgport=5432 \n                                                             --with-perl \n                                                             --with-python \n                                                             --with-openssl \n                                                             --with-pam \n                                                             --with-ldap \n                                                             --with-libxml \n                                                             --with-libxslt \n                                                             --with-segsize=${SEGSIZE} \n                                                             --with-blocksize=${BLOCKSIZE} \n                                                             --with-wal-segsize=${WALSEGSIZE}  \n                                                             --with-systemd\npostgres@pgbox:\/var\/tmp\/postgresql-10.5\/ [pg103] make -j 4 all\npostgres@pgbox:\/var\/tmp\/postgresql-10.5\/ [pg103] rm -rf \/var\/tmp\/pg105\/\npostgres@pgbox:\/var\/tmp\/postgresql-10.5\/ [pg103] make install\n<\/pre>\n<p>What do we have now?<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">\npostgres@pgbox:\/var\/tmp\/postgresql-10.5\/ [pg103] du -sh \/var\/tmp\/pg105\/\n25M\t\/var\/tmp\/pg105\/\n<\/pre>\n<p>We saved another 3MB. Can we do more? Let&#8217;s try to skip all the &#8220;&#8211;with&#8221; flags that enable perl and so on for the configure command:<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">\npostgres@pgbox:\/var\/tmp\/postgresql-10.5\/ [pg103] make clean\npostgres@pgbox:\/var\/tmp\/postgresql-10.5\/ [pg103] .\/configure --prefix=${PGHOME} \n                                                             --exec-prefix=${PGHOME} \n                                                             --bindir=${PGHOME}\/bin \n                                                             --libdir=${PGHOME}\/lib \n                                                             --sysconfdir=${PGHOME}\/etc \n                                                             --includedir=${PGHOME}\/include \n                                                             --datarootdir=${PGHOME}\/share \n                                                             --datadir=${PGHOME}\/share \n                                                             --with-pgport=5432 \n                                                             --with-segsize=${SEGSIZE} \n                                                             --with-blocksize=${BLOCKSIZE} \n                                                             --with-wal-segsize=${WALSEGSIZE}  \n                                                             --with-systemd\npostgres@pgbox:\/var\/tmp\/postgresql-10.5\/ [pg103] make -j 4 all\npostgres@pgbox:\/var\/tmp\/postgresql-10.5\/ [pg103] rm -rf \/var\/tmp\/pg105\/\npostgres@pgbox:\/var\/tmp\/postgresql-10.5\/ [pg103] make install\n<\/pre>\n<p>Do we see a change?<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">\npostgres@pgbox:\/var\/tmp\/postgresql-10.5\/ [pg103] du -sh \/var\/tmp\/pg105\/\n25M\t\/var\/tmp\/pg105\/\n<\/pre>\n<p>No, that does not change anything. Franck <a href=\"https:\/\/linux.die.net\/man\/1\/strip\" target=\"_blank\" rel=\"noopener\">stripped<\/a> the Oracle binaries and libraries, so lets try to do the same (although I am not sure right now if that is supported):<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">\npostgres@pgbox:\/var\/tmp\/postgresql-10.5\/ [pg103] du -sh \/var\/tmp\/pg105\/\n25M\t\/var\/tmp\/pg105\/\npostgres@pgbox:\/var\/tmp\/postgresql-10.5\/ [pg103] strip \/var\/tmp\/pg105\/bin\/*\npostgres@pgbox:\/var\/tmp\/postgresql-10.5\/ [pg103] strip \/var\/tmp\/pg105\/lib\/*\nstrip: Warning: '\/var\/tmp\/pg105\/lib\/pkgconfig' is not an ordinary file\nstrip: Warning: '\/var\/tmp\/pg105\/lib\/postgresql' is not an ordinary file\npostgres@pgbox:\/var\/tmp\/postgresql-10.5\/ [pg103] du -sh \/var\/tmp\/pg105\/\n24M\t\/var\/tmp\/pg105\/\n<\/pre>\n<p>So, another 1MB less. Can we still initialize and start PostgreSQL?<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">\npostgres@pgbox:\/var\/tmp\/postgresql-10.5\/ [pg103] \/var\/tmp\/pg105\/bin\/initdb -D \/var\/tmp\/testpg\nThe files belonging to this database system will be owned by user \"postgres\".\nThis user must also own the server process.\n\nThe database cluster will be initialized with locales\n  COLLATE:  en_US.utf8\n  CTYPE:    en_US.utf8\n  MESSAGES: en_US.utf8\n  MONETARY: de_CH.UTF-8\n  NUMERIC:  de_CH.UTF-8\n  TIME:     en_US.UTF-8\nThe default database encoding has accordingly been set to \"UTF8\".\nThe default text search configuration will be set to \"english\".\n\nData page checksums are disabled.\n\ncreating directory \/var\/tmp\/testpg ... ok\ncreating subdirectories ... ok\nselecting default max_connections ... 100\nselecting default shared_buffers ... 128MB\nselecting dynamic shared memory implementation ... posix\ncreating configuration files ... ok\nrunning bootstrap script ... ok\nperforming post-bootstrap initialization ... ok\nsyncing data to disk ... ok\n\nWARNING: enabling \"trust\" authentication for local connections\nYou can change this by editing pg_hba.conf or using the option -A, or\n--auth-local and --auth-host, the next time you run initdb.\n\nSuccess. You can now start the database server using:\n\n    \/var\/tmp\/pg105\/bin\/pg_ctl -D \/var\/tmp\/testpg -l logfile start\n\npostgres@pgbox:\/var\/tmp\/postgresql-10.5\/ [pg103] \/var\/tmp\/pg105\/bin\/pg_ctl -D \/var\/tmp\/testpg\/ start\nwaiting for server to start....2018-08-17 18:57:50.329 CEST [8528] LOG:  listening on IPv6 address \"::1\", port 5432\n2018-08-17 18:57:50.329 CEST [8528] LOG:  listening on IPv4 address \"127.0.0.1\", port 5432\n2018-08-17 18:57:50.334 CEST [8528] LOG:  listening on Unix socket \"\/tmp\/.s.PGSQL.5432\"\n2018-08-17 18:57:50.354 CEST [8529] LOG:  database system was shut down at 2018-08-17 18:57:31 CEST\n2018-08-17 18:57:50.358 CEST [8528] LOG:  database system is ready to accept connections\n done\nserver started\n<\/pre>\n<p>Looks good and we are able to connect:<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">\npostgres@pgbox:\/var\/tmp\/postgresql-10.5\/ [pg103] \/var\/tmp\/pg105\/bin\/psql -c \"select version()\" postgres\n                                                 version                                                 \n---------------------------------------------------------------------------------------------------------\n PostgreSQL 10.5 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-28), 64-bit\n(1 row)\n\nTime: 1.428 ms\n<\/pre>\n<p>What else can we do? When you do not need the utilities on the server you could just remove them (as said, this is a fun post, don&#8217;t do this):<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">\npostgres@pgbox:\/var\/tmp\/postgresql-10.5\/ [pg103] cd \/var\/tmp\/pg105\/bin\npostgres@pgbox:\/var\/tmp\/pg105\/bin\/ [pg103] rm clusterdb createdb createuser dropdb dropuser pg_archivecleanup pg_basebackup pg_dump pg_dumpall pg_isready pg_receivewal pg_recvlogical pg_resetwal pg_restore pg_rewind pg_test_fsync pg_test_timing pg_upgrade pg_waldump reindexdb vacuumdb\n<\/pre>\n<p>We could probably even remove pgbench and psql but these two I will need to show that the server is still working. What do we have now?<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">\npostgres@pgbox:\/var\/tmp\/pg105\/bin\/ [pg103] du -sh \/var\/tmp\/pg105\/\n21M\t\/var\/tmp\/pg105\/\n<\/pre>\n<p>Another 3MB less. Can we still restart and connect?<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">\npostgres@pgbox:\/var\/tmp\/pg105\/bin\/ [pg103] \/var\/tmp\/pg105\/bin\/pg_ctl -D \/var\/tmp\/testpg\/ stop\nwaiting for server to shut down....2018-08-17 19:08:49.588 CEST [9144] LOG:  received fast shutdown request\n2018-08-17 19:08:49.593 CEST [9144] LOG:  aborting any active transactions\n2018-08-17 19:08:49.597 CEST [9144] LOG:  worker process: logical replication launcher (PID 9151) exited with exit code 1\n2018-08-17 19:08:49.598 CEST [9146] LOG:  shutting down\n2018-08-17 19:08:49.625 CEST [9144] LOG:  database system is shut down\n done\nserver stopped\npostgres@pgbox:\/var\/tmp\/pg105\/bin\/ [pg103] \/var\/tmp\/pg105\/bin\/pg_ctl -D \/var\/tmp\/testpg\/ start\nwaiting for server to start....2018-08-17 19:08:51.949 CEST [9368] LOG:  listening on IPv6 address \"::1\", port 9999\n2018-08-17 19:08:51.949 CEST [9368] LOG:  listening on IPv4 address \"127.0.0.1\", port 9999\n2018-08-17 19:08:51.953 CEST [9368] LOG:  listening on Unix socket \"\/tmp\/.s.PGSQL.9999\"\n2018-08-17 19:08:51.966 CEST [9369] LOG:  database system was shut down at 2018-08-17 19:08:49 CEST\n2018-08-17 19:08:51.969 CEST [9368] LOG:  database system is ready to accept connections\n done\nserver started\npostgres@pgbox:\/var\/tmp\/pg105\/bin\/ [pg103] \/var\/tmp\/pg105\/bin\/psql -c \"select version()\" postgres\n                                                 version                                                 \n---------------------------------------------------------------------------------------------------------\n PostgreSQL 10.5 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-28), 64-bit\n(1 row)\n\nTime: 2.043 ms\n<\/pre>\n<p>Looks good. Now lets do the final step and remove the rest which is not required for the server, but before that we do an initdb as we can not do that afterwards:<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">\npostgres@pgbox:\/var\/tmp\/pg105\/bin\/ [pg103] \/var\/tmp\/pg105\/bin\/pg_ctl -D \/var\/tmp\/testpg\/ stop\nwaiting for server to shut down....2018-08-17 19:10:31.693 CEST [9368] LOG:  received fast shutdown request\n2018-08-17 19:10:31.696 CEST [9368] LOG:  aborting any active transactions\n2018-08-17 19:10:31.696 CEST [9368] LOG:  worker process: logical replication launcher (PID 9375) exited with exit code 1\n2018-08-17 19:10:31.697 CEST [9370] LOG:  shutting down\n2018-08-17 19:10:31.712 CEST [9368] LOG:  database system is shut down\n done\nserver stopped\npostgres@pgbox:\/var\/tmp\/pg105\/bin\/ [pg103] rm -rf \/var\/tmp\/testpg\/\npostgres@pgbox:\/var\/tmp\/pg105\/bin\/ [pg103] \/var\/tmp\/pg105\/bin\/initdb -D \/var\/tmp\/testpg\nThe files belonging to this database system will be owned by user \"postgres\".\nThis user must also own the server process.\n\nThe database cluster will be initialized with locales\n  COLLATE:  en_US.utf8\n  CTYPE:    en_US.utf8\n  MESSAGES: en_US.utf8\n  MONETARY: de_CH.UTF-8\n  NUMERIC:  de_CH.UTF-8\n  TIME:     en_US.UTF-8\nThe default database encoding has accordingly been set to \"UTF8\".\nThe default text search configuration will be set to \"english\".\n\nData page checksums are disabled.\n\ncreating directory \/var\/tmp\/testpg ... ok\ncreating subdirectories ... ok\nselecting default max_connections ... 100\nselecting default shared_buffers ... 128MB\nselecting dynamic shared memory implementation ... posix\ncreating configuration files ... ok\nrunning bootstrap script ... ok\nperforming post-bootstrap initialization ... ok\nsyncing data to disk ... ok\n\nWARNING: enabling \"trust\" authentication for local connections\nYou can change this by editing pg_hba.conf or using the option -A, or\n--auth-local and --auth-host, the next time you run initdb.\n\nSuccess. You can now start the database server using:\n\n    \/var\/tmp\/pg105\/bin\/pg_ctl -D \/var\/tmp\/testpg -l logfile start\n<\/pre>\n<p>So, remove the rest:<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">\npostgres@pgbox:\/var\/tmp\/pg105\/bin\/ [pg103] rm pg_config pg_controldata psql pgbench initdb ecpg pgbench pg_ctl\npostgres@pgbox:\/var\/tmp\/pg105\/bin\/ [pg103] du -sh \/var\/tmp\/pg105\/\n20M\t\/var\/tmp\/pg105\/\n<\/pre>\n<p>We are down to 20MB but we can still start the instance:<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">\npostgres@pgbox:\/var\/tmp\/pg105\/bin\/ [pg103] \/var\/tmp\/pg105\/bin\/postgres -D \/var\/tmp\/testpg\/ &amp;\n[1] 9486\npostgres@pgbox:\/var\/tmp\/pg105\/bin\/ [pg103] 2018-08-17 19:13:54.917 CEST [9486] LOG:  listening on IPv6 address \"::1\", port 9999\n2018-08-17 19:13:54.917 CEST [9486] LOG:  listening on IPv4 address \"127.0.0.1\", port 9999\n2018-08-17 19:13:54.924 CEST [9486] LOG:  listening on Unix socket \"\/tmp\/.s.PGSQL.9999\"\n2018-08-17 19:13:54.955 CEST [9487] LOG:  database system was shut down at 2018-08-17 19:10:56 CEST\n2018-08-17 19:13:54.960 CEST [9486] LOG:  database system is ready to accept connections\n\npostgres@pgbox:\/var\/tmp\/pg105\/bin\/ [pg103] ps -ef | grep postgres\nroot      1061   941  0 18:26 ?        00:00:00 sshd: postgres [priv]\npostgres  1064  1061  0 18:26 ?        00:00:02 sshd: postgres@pts\/0\npostgres  1065  1064  0 18:26 pts\/0    00:00:01 -bash\npostgres  9486  1065  0 19:13 pts\/0    00:00:00 \/var\/tmp\/pg105\/bin\/postgres -D \/var\/tmp\/testpg\/\npostgres  9488  9486  0 19:13 ?        00:00:00 postgres: checkpointer process   \npostgres  9489  9486  0 19:13 ?        00:00:00 postgres: writer process   \npostgres  9490  9486  0 19:13 ?        00:00:00 postgres: wal writer process   \npostgres  9491  9486  0 19:13 ?        00:00:00 postgres: autovacuum launcher process   \npostgres  9492  9486  0 19:13 ?        00:00:00 postgres: stats collector process   \npostgres  9493  9486  0 19:13 ?        00:00:00 postgres: bgworker: logical replication launcher  \npostgres  9496  1065  0 19:14 pts\/0    00:00:00 ps -ef\npostgres  9497  1065  0 19:14 pts\/0    00:00:00 grep --color=auto postgres\n<\/pre>\n<p>Using another psql on that box we can confirm that we can connect:<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">\npostgres@pgbox:\/var\/tmp\/pg105\/bin\/ [pg103] \/u01\/app\/postgres\/product\/10\/db_4\/bin\/psql -c \"select version()\" postgres\n                                                 version                                                 \n---------------------------------------------------------------------------------------------------------\n PostgreSQL 10.5 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-28), 64-bit\n(1 row)\n<\/pre>\n<p>Still too much? What else can we? What is consuming space:<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">\npostgres@pgbox:\/var\/tmp\/pg105\/bin\/ [pg103] du -sh \/var\/tmp\/pg105\/*\n6.6M\t\/var\/tmp\/pg105\/bin\n5.9M\t\/var\/tmp\/pg105\/include\n4.1M\t\/var\/tmp\/pg105\/lib\n2.9M\t\/var\/tmp\/pg105\/share\n<\/pre>\n<p>We can not do more in the &#8220;bin&#8221; directory, nothing left to delete:<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">\npostgres@pgbox:\/var\/tmp\/pg105\/bin\/ [pg103] ls -l \/var\/tmp\/pg105\/bin\ntotal 6660\n-rwxr-xr-x. 1 postgres postgres 6817480 Aug 17 18:56 postgres\nlrwxrwxrwx. 1 postgres postgres       8 Aug 17 18:54 postmaster -&gt; postgres\n<\/pre>\n<p>Everything else will probably safe us a few bytes such as the sample files:<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">\npostgres@pgbox:\/var\/tmp\/pg105\/ [pg103] find . -name *sample*\n.\/share\/postgresql\/tsearch_data\/synonym_sample.syn\n.\/share\/postgresql\/tsearch_data\/thesaurus_sample.ths\n.\/share\/postgresql\/tsearch_data\/hunspell_sample.affix\n.\/share\/postgresql\/tsearch_data\/ispell_sample.affix\n.\/share\/postgresql\/tsearch_data\/ispell_sample.dict\n.\/share\/postgresql\/tsearch_data\/hunspell_sample_long.affix\n.\/share\/postgresql\/tsearch_data\/hunspell_sample_long.dict\n.\/share\/postgresql\/tsearch_data\/hunspell_sample_num.affix\n.\/share\/postgresql\/tsearch_data\/hunspell_sample_num.dict\n.\/share\/postgresql\/pg_hba.conf.sample\n.\/share\/postgresql\/pg_ident.conf.sample\n.\/share\/postgresql\/postgresql.conf.sample\n.\/share\/postgresql\/recovery.conf.sample\n.\/share\/postgresql\/pg_service.conf.sample\n.\/share\/postgresql\/psqlrc.sample\n<\/pre>\n<p>So how much space do we consume for the PostgreSQL installation and the files which make up the instance?<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">\npostgres@pgbox:\/var\/tmp\/pg105\/bin\/ [pg103] du -sh \/var\/tmp\/pg105\/\n20M\t\/var\/tmp\/pg105\/\npostgres@pgbox:\/var\/tmp\/pg105\/bin\/ [pg103] du -sh \/var\/tmp\/testpg\/\n41M\t\/var\/tmp\/testpg\/\n<\/pre>\n<p>&#8230; 61MB. When we add the wal file Jan mentioned in his tweet we come the 77MB. Not much. <\/p>\n<p>The final question is if PostgreSQL is still working. Let&#8217;s use pgbench from another installation on the same server against this:<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">\npostgres@pgbox:\/var\/tmp\/pg105\/ [pg103] \/u01\/app\/postgres\/product\/10\/db_3\/bin\/pgbench -i -s 10 postgres\nNOTICE:  table \"pgbench_history\" does not exist, skipping\nNOTICE:  table \"pgbench_tellers\" does not exist, skipping\nNOTICE:  table \"pgbench_accounts\" does not exist, skipping\nNOTICE:  table \"pgbench_branches\" does not exist, skipping\ncreating tables...\n100000 of 1000000 tuples (10%) done (elapsed 0.08 s, remaining 0.75 s)\n200000 of 1000000 tuples (20%) done (elapsed 0.24 s, remaining 0.95 s)\n300000 of 1000000 tuples (30%) done (elapsed 0.42 s, remaining 0.98 s)\n400000 of 1000000 tuples (40%) done (elapsed 0.49 s, remaining 0.74 s)\n500000 of 1000000 tuples (50%) done (elapsed 0.70 s, remaining 0.70 s)\n600000 of 1000000 tuples (60%) done (elapsed 0.88 s, remaining 0.58 s)\n700000 of 1000000 tuples (70%) done (elapsed 0.95 s, remaining 0.41 s)\n800000 of 1000000 tuples (80%) done (elapsed 1.14 s, remaining 0.29 s)\n900000 of 1000000 tuples (90%) done (elapsed 1.32 s, remaining 0.15 s)\n1000000 of 1000000 tuples (100%) done (elapsed 1.41 s, remaining 0.00 s)\nvacuum...\nset primary keys...\ndone.\npostgres@pgbox:\/var\/tmp\/pg105\/ [pg103] \/u01\/app\/postgres\/product\/10\/db_3\/bin\/pgbench -s 10 postgres\nscale option ignored, using count from pgbench_branches table (10)\nstarting vacuum...end.\ntransaction type: \nscaling factor: 10\nquery mode: simple\nnumber of clients: 1\nnumber of threads: 1\nnumber of transactions per client: 10\nnumber of transactions actually processed: 10\/10\nlatency average = 4.436 ms\ntps = 225.435296 (including connections establishing)\ntps = 285.860401 (excluding connections establishing)\n<\/pre>\n<p>Looks good. So you can come down to 20MB for the PostgreSQL installation and another 41Mb for the files you need to start the instance. You could even drop the postgres database to save another 7MB. But remember: Please don&#8217;t do that, you are still fine with around 30MB \ud83d\ude42<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A recent blog post from Franck and a tweet around that topic is the inspiration for this blog post, thanks Jan for requesting :). In short it is about how small you can get the binaries. Is that important? At least when it comes to Docker images it might get important as you usually try [&hellip;]<\/p>\n","protected":false},"author":29,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[229],"tags":[77],"type_dbi":[],"class_list":["post-11576","post","type-post","status-publish","format-standard","hentry","category-database-administration-monitoring","tag-postgresql"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.2 (Yoast SEO v27.2) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>The size of Oracle Home: from 9GB to 600MB - What about PostgreSQL? - dbi Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.dbi-services.com\/blog\/the-size-of-oracle-home-from-9gb-to-600mb-what-about-postgresql\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"The size of Oracle Home: from 9GB to 600MB - What about PostgreSQL?\" \/>\n<meta property=\"og:description\" content=\"A recent blog post from Franck and a tweet around that topic is the inspiration for this blog post, thanks Jan for requesting :). In short it is about how small you can get the binaries. Is that important? At least when it comes to Docker images it might get important as you usually try [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.dbi-services.com\/blog\/the-size-of-oracle-home-from-9gb-to-600mb-what-about-postgresql\/\" \/>\n<meta property=\"og:site_name\" content=\"dbi Blog\" \/>\n<meta property=\"article:published_time\" content=\"2018-08-17T16:20:22+00:00\" \/>\n<meta name=\"author\" content=\"Daniel Westermann\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@westermanndanie\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Daniel Westermann\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"12 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/the-size-of-oracle-home-from-9gb-to-600mb-what-about-postgresql\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/the-size-of-oracle-home-from-9gb-to-600mb-what-about-postgresql\/\"},\"author\":{\"name\":\"Daniel Westermann\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/8d08e9bd996a89bd75c0286cbabf3c66\"},\"headline\":\"The size of Oracle Home: from 9GB to 600MB &#8211; What about PostgreSQL?\",\"datePublished\":\"2018-08-17T16:20:22+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/the-size-of-oracle-home-from-9gb-to-600mb-what-about-postgresql\/\"},\"wordCount\":527,\"commentCount\":0,\"keywords\":[\"PostgreSQL\"],\"articleSection\":[\"Database Administration &amp; Monitoring\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.dbi-services.com\/blog\/the-size-of-oracle-home-from-9gb-to-600mb-what-about-postgresql\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/the-size-of-oracle-home-from-9gb-to-600mb-what-about-postgresql\/\",\"url\":\"https:\/\/www.dbi-services.com\/blog\/the-size-of-oracle-home-from-9gb-to-600mb-what-about-postgresql\/\",\"name\":\"The size of Oracle Home: from 9GB to 600MB - What about PostgreSQL? - dbi Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#website\"},\"datePublished\":\"2018-08-17T16:20:22+00:00\",\"author\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/8d08e9bd996a89bd75c0286cbabf3c66\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/the-size-of-oracle-home-from-9gb-to-600mb-what-about-postgresql\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.dbi-services.com\/blog\/the-size-of-oracle-home-from-9gb-to-600mb-what-about-postgresql\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/the-size-of-oracle-home-from-9gb-to-600mb-what-about-postgresql\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Accueil\",\"item\":\"https:\/\/www.dbi-services.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"The size of Oracle Home: from 9GB to 600MB &#8211; What about PostgreSQL?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#website\",\"url\":\"https:\/\/www.dbi-services.com\/blog\/\",\"name\":\"dbi Blog\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.dbi-services.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/8d08e9bd996a89bd75c0286cbabf3c66\",\"name\":\"Daniel Westermann\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/secure.gravatar.com\/avatar\/31350ceeecb1dd8986339a29bf040d4cd3cd087d410deccd8f55234466d6c317?s=96&d=mm&r=g\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/31350ceeecb1dd8986339a29bf040d4cd3cd087d410deccd8f55234466d6c317?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/31350ceeecb1dd8986339a29bf040d4cd3cd087d410deccd8f55234466d6c317?s=96&d=mm&r=g\",\"caption\":\"Daniel Westermann\"},\"description\":\"Daniel Westermann is Principal Consultant and Technology Leader Open Infrastructure at dbi services. He has more than 15 years of experience in management, engineering and optimization of databases and infrastructures, especially on Oracle and PostgreSQL. Since the beginning of his career, he has specialized in Oracle Technologies and is Oracle Certified Professional 12c and Oracle Certified Expert RAC\/GridInfra. Over time, Daniel has become increasingly interested in open source technologies, becoming \u201cTechnology Leader Open Infrastructure\u201d and PostgreSQL expert. \u00a0Based on community or EnterpriseDB tools, he develops and installs complex high available solutions with PostgreSQL. He is also a certified PostgreSQL Plus 9.0 Professional and a Postgres Advanced Server 9.4 Professional. He is a regular speaker at PostgreSQL conferences in Switzerland and Europe. Today Daniel is also supporting our customers on AWS services such as AWS RDS, database migrations into the cloud, EC2 and automated infrastructure management with AWS SSM (System Manager). He is a certified AWS Solutions Architect Professional. Prior to dbi services, Daniel was Management System Engineer at LC SYSTEMS-Engineering AG in Basel. Before that, he worked as Oracle Developper &amp;\u00a0Project Manager at Delta Energy Solutions AG in Basel (today Powel AG). Daniel holds a diploma in Business Informatics (DHBW, Germany). His branch-related experience mainly covers the pharma industry, the financial sector, energy, lottery and telecommunications.\",\"sameAs\":[\"https:\/\/x.com\/westermanndanie\"],\"url\":\"https:\/\/www.dbi-services.com\/blog\/author\/daniel-westermann\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"The size of Oracle Home: from 9GB to 600MB - What about PostgreSQL? - dbi Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.dbi-services.com\/blog\/the-size-of-oracle-home-from-9gb-to-600mb-what-about-postgresql\/","og_locale":"en_US","og_type":"article","og_title":"The size of Oracle Home: from 9GB to 600MB - What about PostgreSQL?","og_description":"A recent blog post from Franck and a tweet around that topic is the inspiration for this blog post, thanks Jan for requesting :). In short it is about how small you can get the binaries. Is that important? At least when it comes to Docker images it might get important as you usually try [&hellip;]","og_url":"https:\/\/www.dbi-services.com\/blog\/the-size-of-oracle-home-from-9gb-to-600mb-what-about-postgresql\/","og_site_name":"dbi Blog","article_published_time":"2018-08-17T16:20:22+00:00","author":"Daniel Westermann","twitter_card":"summary_large_image","twitter_creator":"@westermanndanie","twitter_misc":{"Written by":"Daniel Westermann","Est. reading time":"12 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.dbi-services.com\/blog\/the-size-of-oracle-home-from-9gb-to-600mb-what-about-postgresql\/#article","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/the-size-of-oracle-home-from-9gb-to-600mb-what-about-postgresql\/"},"author":{"name":"Daniel Westermann","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/8d08e9bd996a89bd75c0286cbabf3c66"},"headline":"The size of Oracle Home: from 9GB to 600MB &#8211; What about PostgreSQL?","datePublished":"2018-08-17T16:20:22+00:00","mainEntityOfPage":{"@id":"https:\/\/www.dbi-services.com\/blog\/the-size-of-oracle-home-from-9gb-to-600mb-what-about-postgresql\/"},"wordCount":527,"commentCount":0,"keywords":["PostgreSQL"],"articleSection":["Database Administration &amp; Monitoring"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.dbi-services.com\/blog\/the-size-of-oracle-home-from-9gb-to-600mb-what-about-postgresql\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.dbi-services.com\/blog\/the-size-of-oracle-home-from-9gb-to-600mb-what-about-postgresql\/","url":"https:\/\/www.dbi-services.com\/blog\/the-size-of-oracle-home-from-9gb-to-600mb-what-about-postgresql\/","name":"The size of Oracle Home: from 9GB to 600MB - What about PostgreSQL? - dbi Blog","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/#website"},"datePublished":"2018-08-17T16:20:22+00:00","author":{"@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/8d08e9bd996a89bd75c0286cbabf3c66"},"breadcrumb":{"@id":"https:\/\/www.dbi-services.com\/blog\/the-size-of-oracle-home-from-9gb-to-600mb-what-about-postgresql\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.dbi-services.com\/blog\/the-size-of-oracle-home-from-9gb-to-600mb-what-about-postgresql\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.dbi-services.com\/blog\/the-size-of-oracle-home-from-9gb-to-600mb-what-about-postgresql\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Accueil","item":"https:\/\/www.dbi-services.com\/blog\/"},{"@type":"ListItem","position":2,"name":"The size of Oracle Home: from 9GB to 600MB &#8211; What about PostgreSQL?"}]},{"@type":"WebSite","@id":"https:\/\/www.dbi-services.com\/blog\/#website","url":"https:\/\/www.dbi-services.com\/blog\/","name":"dbi Blog","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.dbi-services.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/8d08e9bd996a89bd75c0286cbabf3c66","name":"Daniel Westermann","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/31350ceeecb1dd8986339a29bf040d4cd3cd087d410deccd8f55234466d6c317?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/31350ceeecb1dd8986339a29bf040d4cd3cd087d410deccd8f55234466d6c317?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/31350ceeecb1dd8986339a29bf040d4cd3cd087d410deccd8f55234466d6c317?s=96&d=mm&r=g","caption":"Daniel Westermann"},"description":"Daniel Westermann is Principal Consultant and Technology Leader Open Infrastructure at dbi services. He has more than 15 years of experience in management, engineering and optimization of databases and infrastructures, especially on Oracle and PostgreSQL. Since the beginning of his career, he has specialized in Oracle Technologies and is Oracle Certified Professional 12c and Oracle Certified Expert RAC\/GridInfra. Over time, Daniel has become increasingly interested in open source technologies, becoming \u201cTechnology Leader Open Infrastructure\u201d and PostgreSQL expert. \u00a0Based on community or EnterpriseDB tools, he develops and installs complex high available solutions with PostgreSQL. He is also a certified PostgreSQL Plus 9.0 Professional and a Postgres Advanced Server 9.4 Professional. He is a regular speaker at PostgreSQL conferences in Switzerland and Europe. Today Daniel is also supporting our customers on AWS services such as AWS RDS, database migrations into the cloud, EC2 and automated infrastructure management with AWS SSM (System Manager). He is a certified AWS Solutions Architect Professional. Prior to dbi services, Daniel was Management System Engineer at LC SYSTEMS-Engineering AG in Basel. Before that, he worked as Oracle Developper &amp;\u00a0Project Manager at Delta Energy Solutions AG in Basel (today Powel AG). Daniel holds a diploma in Business Informatics (DHBW, Germany). His branch-related experience mainly covers the pharma industry, the financial sector, energy, lottery and telecommunications.","sameAs":["https:\/\/x.com\/westermanndanie"],"url":"https:\/\/www.dbi-services.com\/blog\/author\/daniel-westermann\/"}]}},"_links":{"self":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/11576","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/users\/29"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/comments?post=11576"}],"version-history":[{"count":0,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/11576\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/media?parent=11576"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/categories?post=11576"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/tags?post=11576"},{"taxonomy":"type","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/type_dbi?post=11576"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}