Unix Technical Forum

BUG #2298: Bug using copy

This is a discussion on BUG #2298: Bug using copy within the pgsql Bugs forums, part of the PostgreSQL category; --> The following bug has been logged online: Bug reference: 2298 Logged by: Nahum Castro Email address: pedro1_72@yahoo.com PostgreSQL version: ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Bugs

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-10-2008, 10:48 AM
Nahum Castro
 
Posts: n/a
Default BUG #2298: Bug using copy


The following bug has been logged online:

Bug reference: 2298
Logged by: Nahum Castro
Email address: pedro1_72@yahoo.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@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@localhost datos]$ pwd
/home/geografia/datos
[geografia@localhost datos]$ psql geoest
Bienvenido a psql 8.1.1, la terminal interactiva de PostgreSQL.

Digite: \copyright para ver los términos de distribución
\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@postgresql.org so that your
message can get through to the mailing list cleanly

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-10-2008, 10:48 AM
Bruce Momjian
 
Posts: n/a
Default Re: BUG #2298: Bug using copy


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@yahoo.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@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@localhost datos]$ pwd
> /home/geografia/datos
> [geografia@localhost datos]$ psql geoest
> Bienvenido a psql 8.1.1, la terminal interactiva de PostgreSQL.
>
> Digite: \copyright para ver los términos de distribución
> \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@postgresql.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. +

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 06:07 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com