Re: BUG #2298: Bug using copy

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Nahum Castro <pedro1_72(at)yahoo(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #2298: Bug using copy
Date: 2006-03-05 04:10:18
Message-ID: 200603050410.k254AIJ18593@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


Read the COPY manual page. Permissions for COPY are based on the server
user, not the psql user. Try psql \copy.

---------------------------------------------------------------------------

Nahum Castro wrote:
>
> The following bug has been logged online:
>
> Bug reference: 2298
> Logged by: Nahum Castro
> Email address: pedro1_72(at)yahoo(dot)com
> PostgreSQL version: 8.1.1
> Operating system: Linux Kernel 2.6.22
> Description: Bug using copy
> Details:
>
> When I try to copy from a file using psql I get the permision error, so I
> can not load from any file
> [geografia(at)localhost datos]$ ls -l
> total 96
> -rwxrwxr-x 1 geografia geografia 30189 mar 2 12:52 archivo1.csv
> -rwxrwxrwx 1 geografia geografia 30189 mar 2 12:43 archivo.csv
> -rw-rw-r-- 1 geografia geografia 30189 mar 2 13:32 ar.csv
> [geografia(at)localhost datos]$ pwd
> /home/geografia/datos
> [geografia(at)localhost datos]$ psql geoest
> Bienvenido a psql 8.1.1, la terminal interactiva de PostgreSQL.
>
> Digite: \copyright para ver los trminos de distribucin
> \h para ayuda de comandos SQL
> \? para ayuda de comandos psql
> \g o or termine con punto y coma para ejecutar una consulta
> \q para salir
>
> geoest=# copy datos2 (dato_float, cve_subtema, fecha, fuente, cve_mpio) from
> '/home/geografia/datos/ar.csv' with csv;
> ERROR: no se pudo abrir archivo /home/geografia/datos/ar.csv para
> lectura: Permiso denegado
> geoest=#
>
> But it works if I copy the file to /opt/ and load from there.
> Thanks
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly
>

--
Bruce Momjian http://candle.pha.pa.us
SRA OSS, Inc. http://www.sraoss.com

+ If your life is a hard drive, Christ can be your backup. +

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Bruce Momjian 2006-03-05 04:12:35 Re: General PostgresSQL Query
Previous Message Stephan Szabo 2006-03-05 00:54:09 Re: BUG #2292: Calling conventions in docs