Note: to use pgsql with Debian GNU/Linux's Postfix, all you
need to do is to install the postfix-pgsql package and you're done.
There is no need to recompile Postfix.
In order to build Postfix with pgsql map support, you specify
-DHAS_PGSQL, the directory with the PostgreSQL header files, and
the location of the libpq library file.
% make tidy
% make -f Makefile.init makefiles \
'CCARGS=-DHAS_PGSQL -I/usr/local/include/pgsql' \
Then just run 'make'.