Re: copying table to a file

From: Trurl McByte <trurl(at)realtor3d(dot)odessa(dot)ua>
To: Tyler Robert Wood <twood(at)csd(dot)uwm(dot)edu>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: copying table to a file
Date: 2000-06-17 15:41:36
Message-ID: Pine.LNX.4.20.0006171835120.305-100000@trurl.anything3d.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, 16 Jun 2000 (Yesterday), Tyler Robert Wood wrote:

TRW>
TRW> Hi,
TRW> I am attempting to copy the contents of a table to a file, like this:
TRW>
TRW> foodserver=> COPY company TO '/home/peter/copytest.out';
TRW>
TRW>
TRW> But I keep getting this error:
TRW>
TRW> ERROR: COPY command, running in backend with effective uid 100, could not
TRW> open file '/home/peter/copytest.out' for writing. Errno = Permission
TRW> denied (13).
TRW>
TRW> Does anybody know how I can fix this so I have permission to open files?
Make allow access to '/home/peter' for user #100
Or better make in your home something like:

$ cd /home/peter
$ mkdir sql
$ chmod 777 sql

and after this make

foodserver=> COPY company TO '/home/peter/sql/copytest.out';

Attn: You can have "superuser" permission for work with files from sql!

Method #2:

$ psql foodserver -c "COPY company TO stdout" -o /home/peter/copytest.out

This method don't need "superuser" permission...

--
Trurl McByte, Capt. of StasisCruiser "Prince"
|InterNIC: AR3200 RIPE: AR1627-RIPE|
|--98 C3 78 8E 90 E3 01 35 87 1F 3F EF FD 6D 84 B3--|

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Herbert Liechti 2000-06-17 17:16:04 Re: Lock rekord
Previous Message Martijn van Oosterhout 2000-06-17 14:40:11 Re: copying table to a file