Well, if you're running the latest development version of postgresql, its copy command understands CSV and can suck it right in.
If you're running anything else, it's pretty easy, just write a short file like this:
$fp = fopen($filename,"r");
while (!feof($fp)) {
$line = fgetcsv($fp,4096);
$query = "insert into $table values ('";
$query.= implode("','",$line);
$query.= "')";
pg_exec($conn,$query);
}
this simple code fragment doesn't escape any characters, which it probably should. But it gets the idea across.