Re: TR: Re: TR: interface PERL and return results

From: Jean-Luc Lachance <jllachan(at)nsd(dot)ca>
To: rmunn(at)pobox(dot)com
Cc: "victor3(dot)lopes(at)voila(dot)fr" <victor3(dot)lopes(at)voila(dot)fr>, pgsql-interfaces(at)postgresql(dot)org
Subject: Re: TR: Re: TR: interface PERL and return results
Date: 2002-10-11 14:31:50
Message-ID: 3DA6E0D6.B0DD3486@nsd.ca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

Two things:

The file MUST be on the server where PostgreSQL is running.
The file MUST be accessible by the user postgres.

rmunn(at)pobox(dot)com wrote:
>
> On Fri, Oct 11, 2002 at 12:29:40AM +0200, victor3(dot)lopes(at)voila(dot)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(at)pobox(dot)com
>
> ------------------------------------------------------------------------
> Part 1.2Type: application/pgp-signature

In response to

Browse pgsql-interfaces by date

  From Date Subject
Next Message victor3.lopes 2002-10-11 22:36:37 Re: TR: Re: TR: interface PERL and return results
Previous Message rmunn 2002-10-11 14:22:46 Re: TR: Re: TR: interface PERL and return results