You will need GNU Make to build PostgreSQL. GNU Make is the default in GNU/Linux systems, in other systems it may be called gmake. We are simply going to refer to it as “make”. You can download GNU Make from ftp://ftp.gnu.org.
You will need a C compiler. GCC (GNU Compiler Collection) is what I am using.
You will need C/C++ development libraries. On GNU/Linux systems, this usually means glibc and glibc-devel.
For convenience, install GNU Readline and its development packages (usually readline and readline-devel).
(Optional) If you are going to use psql from an X Terminal, then install the X development libraries.
A minimum of 35 Mb of disk space is necessary to build PostgreSQL (including the sources). Of course, you will need more to create databases, so be generous :-)
Compiling gives you more flexibility because you can compile PostgreSQL with some extra options (and we will mention some here). It is not a super trivial process, but it is not too hard. Following this guide will help a lot, but some understanding of what's going on is expected of you.
If you are completely new to UNIX systems or if you just want to get it up and running fast, then go with a binary installation, such as the ones provided by RPMs (Red Hat packages, provided in most GNU/Linux distributions) and DEBs (Debian GNU/Linux packages).