Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 49F934765CB for ; Fri, 11 Oct 2002 10:32:34 -0400 (EDT) Received: from beamish.nsd.ca (unknown [205.150.156.194]) by postgresql.org (Postfix) with ESMTP id 8FE154765A0 for ; Fri, 11 Oct 2002 10:32:33 -0400 (EDT) Received: (from smap@localhost) by beamish.nsd.ca (8.9.3/8.9.3) id KAA10975; Fri, 11 Oct 2002 10:31:30 -0400 X-Authentication-Warning: beamish.nsd.ca: smap set sender to using -f Received: from reddog.nsd.ca(192.168.101.30) by beamish.nsd.ca via smap (V2.1/2.1+anti-relay+anti-spam) id xma010971; Fri, 11 Oct 02 10:31:14 -0400 Received: from nsd.ca (jllachan-linux.nsd.ca [192.168.101.148]) by reddog.nsd.ca (8.8.7/8.8.7) with ESMTP id KAA29677; Fri, 11 Oct 2002 10:30:51 -0400 Message-ID: <3DA6E0D6.B0DD3486@nsd.ca> Date: Fri, 11 Oct 2002 10:31:50 -0400 From: Jean-Luc Lachance X-Mailer: Mozilla 4.77 [en] (X11; U; Linux 2.4.9-31 i686) X-Accept-Language: en MIME-Version: 1.0 To: rmunn@pobox.com Cc: "victor3.lopes@voila.fr" , pgsql-interfaces@postgresql.org Subject: Re: TR: Re: TR: interface PERL and return results References: <20021011055654.GA32131@rmunnlfs> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200210/28 X-Sequence-Number: 3190 Two things: The file MUST be on the server where PostgreSQL is running. The file MUST be accessible by the user postgres. rmunn@pobox.com wrote: > > 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... > > > > I have try two methods for charge my result.res in my table. > > > > the first method : > > > > $res = $db->exec(" COPY temp FROM "full path\result.res "); > > > > Unfortunately I did not succeed in using this method, I had always an > > error ( While placing postgres in debug mode ). > > > > DEBUG: StartTransactionCommand > > DEBUG: query: COPY temp FROM '-- my path -- /result.res' > > DEBUG: parse tree: { QUERY :command 5 :utility ? :resultRelation 0 :into <> > > :isPortal false :isBinary false :isTemp false :hasAggs false :hasSubLinks false :rtable > > <> :jointree <> :rowMarks () :targetList <> :groupClause <> :havingQual <> > > :distinctClause <> :sortClause <> :limitOffset <> :limitCount <> :setOperations <> > > :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 also works for > > anyone. > > .... > > > > 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. > > -- > Robin Munn > rmunn@pobox.com > > ------------------------------------------------------------------------ > Part 1.2Type: application/pgp-signature