http://www.perlmonks.org?node_id=847491


in reply to DBD:Pg pg_putcopydata

Keep in mind that you can also directly pipe data to postgres' COPY via psql:

# for instance, a program producing tab-delimited output: perl my_tsv.pl | psql -d dbname -c "copy mytable from stdin csv delimi +ter E'\t'"
# or if the data is in a tsv file already: < data.tsv psql -d dbname -c "copy mytable from stdin csv delimiter E' +\t'"