pg-cmd - PostgreSQL interactive and batch query command-line tool »
pg-cmd can run in batch mode, like this:
pg-cmd dsn="pan:withdata@192.168.0.102:5432/test" task=load table=media_messages datafile=f:\media_messages.txt delimiter=, quote=" header=y quit=y