Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id DFDFC475C5F for ; Fri, 11 Oct 2002 01:56:48 -0400 (EDT) Received: from rmunnlfs.dyndns.org (adsl-65-42-87-38.dsl.chcgil.ameritech.net [65.42.87.38]) by postgresql.org (Postfix) with ESMTP id 9AC5B47601E for ; Fri, 11 Oct 2002 01:56:39 -0400 (EDT) Received: from rmunn by rmunnlfs.dyndns.org with local (Exim 4.10) id 17zsn8-00012q-00; Fri, 11 Oct 2002 00:56:54 -0500 Date: Fri, 11 Oct 2002 00:56:54 -0500 From: rmunn@pobox.com To: "victor3.lopes@voila.fr" Cc: pgsql-interfaces@postgresql.org Subject: Re: TR: Re: TR: interface PERL and return results Message-ID: <20021011055654.GA32131@rmunnlfs> References: Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="0F1p//8PRICkK4MW" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4i X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200210/24 X-Sequence-Number: 3186 --0F1p//8PRICkK4MW Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Oct 11, 2002 at 12:29:40AM +0200, victor3.lopes@voila.fr wrote: > Hello, anyone have a response of my problem ? Maybe. See below... >=20 > I have try two methods for charge my result.res in my table. >=20 > the first method : >=20 > $res =3D $db->exec(" COPY temp FROM "full path\result.res "); >=20 > Unfortunately I did not succeed in using this method, I had always an > error ( While placing postgres in debug mode ). >=20 > DEBUG: StartTransactionCommand > DEBUG: query: COPY temp FROM '-- my path -- /result.res' > DEBUG: parse tree: { QUERY :command 5 :utility ? :resultRelation 0 :in= to <> > :isPortal false :isBinary false :isTemp false :hasAggs false :hasSubLinks= false :rtable > <> :jointree <> :rowMarks () :targetList <> :groupClause <> :havingQual <> > :distinctClause <> :sortClause <> :limitOffset <> :limitCount <> :setOper= ations <> > :resultRelations ()} > DEBUG: ProcessUtility: COPY temp FROM '-- my path -- /result.res' > 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 als= o works for > anyone. > .... >=20 > I don't understand why this error because the superuser postgres (who had= create for > launch the server) have the privilege > for access and read this file. In your Perl script, what user and password did you use to connect to the database? You need to *connect* as the Postgres superuser (which is almost always the user named 'postgres'). If you are connected as user postgres then your COPY command should work. --=20 Robin Munn rmunn@pobox.com --0F1p//8PRICkK4MW Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (GNU/Linux) iD8DBQE9pmglhF2s/Wr7aDgRAmVlAJ91fQmqLwU2i9Bbjml61RV29uU9dgCggFe0 +U8paljZlI830q++PghQd4U= =UPC6 -----END PGP SIGNATURE----- --0F1p//8PRICkK4MW--