in reply to Re^2: DBD::Pg copy issues
in thread DBD::Pg copy issues
If you already have the information inside perl here's an example. Be really careful to use only unix line endings - PostgreSQL's copy command is very particular about that.
# Start copying some data to PostgeSQL. Here, STDIN is relative to the # script. So the PostgreSQL STDIN being mentioned is actually just the # stuff being written over $dbh->func( ..., 'putline'); $dbh->func( 'COPY some_table FROM STDIN', 'putline' ); # Write whatever was read from $fh to PostgreSQL's COPY. while ( <$fh> ) { chomp; $dbh->func( $_, 'putline' ); } # Tell PostgreSQL that the COPY is over with. $dbh->func( "\\.\n", 'putline' );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: DBD::Pg copy issues
by tradez (Pilgrim) on Sep 10, 2004 at 19:58 UTC | |
by diotalevi (Canon) on Sep 10, 2004 at 21:19 UTC | |
by tradez (Pilgrim) on Sep 14, 2004 at 19:42 UTC | |
by diotalevi (Canon) on Sep 14, 2004 at 22:38 UTC | |
by tradez (Pilgrim) on Sep 15, 2004 at 15:40 UTC |