I am loading up lots and lots of data, and need to track what is going on, but I really don’t need all of the stuff that DBIx::Class brings with it. So I got a clue today and decided I was just going to use copy directly, picking off the file, gunzip-ping it, and using system to execute a psql copy call.
But, when I went to edit my code, I realized that I forgot about stuff like passwords and ports and hosts and all that junk that is nice to have in a portable perl script.
CPAN docs to the rescue! First I found out that indeed DBD::Pg can do copy() calls. Then I scanned around in the DBIx::Class docs and found a code snippet in the Storage docs that said how to use dbh_do.
My final script is pretty simple compared to the line by line code that I was trying to optimize for speed.