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
In reply to Re: pg_getcopydata failing to get copy data using documented syntax
by NetWallah
in thread pg_getcopydata failing to get copy data using documented syntax
by bitvector
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |