Forum OpenACS Q&A: Response to problems installing postgres7.1.3
Alaa, next time give us more details so we can answer your question better. You didn't especify which platform you're trying to compile PostgreSQL under (GNU/Linux, *BSD, HP/UX, Solaris, Windows).
I second the recommendation to start with PostgreSQL 7.2.1. If you are using GNU/Linux you are probably using a popular distribution which most likely has a package management system (RPMs, DEBs). If so you should use the postgresql packages for that distribution for it'll save you the trouble of compiling from scratch, and will setup nice startup scripts and all that.
Debian has excellent PostgreSQL packages and is a very excellent distribution, although I wouldn't recommend it unless you have previous UNIX experience.