Hi,
I'm writing a CGI script that will import data from a file to a Postgres
table. Since the client using the script then won't be the superuser
I have to use the psql version \COPY. This happens when I run:
use DBI;
use DBIx::Recordset;
$dbh->do("\COPY table FROM 'file.dat'");
Unrecognized escape \C passed through at
/var/www/cgi-bin/marcus/ma_merge2.pl line 54.
DBD::Pg::db do failed: ERROR: You must have Postgres superuser
privilege to do a COPY directly to or from a file. Anyone can COPY to
stdout or from stdin. Psql's \copy command also works for anyone. at
/usr/local/lib/perl5/site_perl/5.6.1/DBIx/Database.pm line 157.
or I try with to \\ : $dbh->do("\\COPY table FROM 'file.dat'");
DBD::Pg::db do failed: ERROR: parser: parse error at or near "\" at
/usr/local/lib/perl5/site_perl/5.6.1/DBIx/Database.pm line 157.
Help, anyone??!
Marcus