in reply to pg_getcopydata failing to get copy data using documented syntax
The first argument to pg_getcopydata is the variable into which the data will be stored (this variable should not be undefined, or it may throw a warning, although it may be a reference)It works fine if you change the line to a REFERENCE to @data, like:
You get a $record_count one higher than necessary.1 while $dbh->pg_getcopydata(\$data[$record_count++]) >= 0;
FYI - you do not need to quote "$schema" or "$table", since you are in a qq().
"Battle not with trolls, lest ye become a troll; and if you gaze into the Internet, the Internet gazes also into you."
-Friedrich Nietzsche: A Dynamic Translation
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: pg_getcopydata failing to get copy data using documented syntax
by bitvector (Initiate) on Dec 28, 2011 at 18:46 UTC | |
by NetWallah (Canon) on Dec 28, 2011 at 19:21 UTC | |
by bitvector (Initiate) on Dec 28, 2011 at 21:16 UTC |