I have very little experience with Perl, and I am also new to this forum. I would greatly appreciate any direct or indirect help with a problem I am currently facing.
My program has several arrays which I intend to push into a pgSQL database. Each array represents a unique table in the database. I have used flat files as a medium for transport in the past, however the scale of data in this project requires more efficiency. After some research I have settled on using the COPY method of moving the data into the db.
So far, I have been able to find very few example of code using the pg_putcopydata method and those I have found I either do not understand or do not use a data structure much like the one I am using (arrays).
Each element in the array @ArrayInMemory will be a row in the db table with multiple columns delimited by /. This is what I image the code will be like:
@ArrayInMemory $dbh->do("COPY mytable(col1, col2, col3) FROM STDIN WITH DELIMITER '/' +"); foreach $row (@ArrayInMemory) { $dbh->pg_putcopydata($row); } $dbh->pg_putcopyend();
Again, thanks for any input on this topic and I hope we can generate a few quality examples for other users who are unfamiliar with the pg_putcopydata database handle method.
In reply to DBD:Pg pg_putcopydata by LiquidT
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |