pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: rmunn@pobox.com
To: 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 00:56:54 -0500
Message-ID: <20021011055654.GA32131@rmunnlfs> (raw)
In-Reply-To: <H3SEHG$B5AAFAF478DAC96A4A5B1720A94451BA@voila.fr>
References: <H3SEHG$B5AAFAF478DAC96A4A5B1720A94451BA@voila.fr>

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

view thread (6+ messages)  latest in thread

Message-ID: <20021011055654.GA32131@rmunnlfs>
Permalink:  ../20021011055654.GA32131@rmunnlfs/
Also on:    postgresql.org/message-id/20021011055654.GA32131@rmunnlfs

 · 

reply

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: rmunn@pobox.com, victor3.lopes@voila.fr
  Subject: Re: TR: Re: TR: interface PERL and return results
  In-Reply-To: <20021011055654.GA32131@rmunnlfs>

* 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