The absolute easiest way to get a CSV into a postgresql table is to use ogr2ogr with AUTODETECT_TYPE=YES.
I learned a while back that this is what cartoDB uses to import your CSV into postgis (with a lot of other parameters added)
ogr2ogr -f PostgreSQL PG:"host=localhost user=postgres dbname=postgres password=password" docs.csv -oo AUTODETECT_TYPE=YES
This interestingly doesn't work with CSVs with only one column. You have to "trick" it by adding a comma right after the first column in the header or by adding a stub second column in the header.