From: Jean-Luc Lachance <jllachan@nsd.ca>
To: rmunn@pobox.com
Cc: victor3.lopes@voila.fr <victor3.lopes@voila.fr>
Cc: pgsql-interfaces@postgresql.org
Subject: Re: TR: Re: TR: interface PERL and return results
Date: Fri, 11 Oct 2002 10:31:50 -0400
Message-ID: <3DA6E0D6.B0DD3486@nsd.ca> (raw)
References: <H3SEHG$B5AAFAF478DAC96A4A5B1720A94451BA@voila.fr>
<20021011055654.GA32131@rmunnlfs>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-interfaces@postgresql.org
Cc: jllachan@nsd.ca, rmunn@pobox.com, victor3.lopes@voila.fr
Subject: Re: TR: Re: TR: interface PERL and return results
In-Reply-To: <3DA6E0D6.B0DD3486@nsd.ca>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox