Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 847E9632997 for ; Wed, 23 Jun 2010 18:01:44 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 24771-01 for ; Wed, 23 Jun 2010 21:01:36 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from kuber.nabble.com (kuber.nabble.com [216.139.236.158]) by mail.postgresql.org (Postfix) with ESMTP id 4EE54632489 for ; Wed, 23 Jun 2010 18:01:37 -0300 (ADT) Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1ORX4h-0003rC-9Z for pgsql-sql@postgresql.org; Wed, 23 Jun 2010 14:01:35 -0700 Message-ID: <28976565.post@talk.nabble.com> Date: Wed, 23 Jun 2010 14:01:35 -0700 (PDT) From: "bruno.scovoli" To: pgsql-sql@postgresql.org Subject: Re: COPY command and required file permissions In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Nabble-From: bruno.scovoli@gmail.com References: X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.011 tagged_above=-5 required=5 tests=BAYES_20=-0.001, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201006/86 X-Sequence-Number: 34277 I have an script with many "\copy" commands. For example: \copy privilegios from '/work/eclipse-workspace/Canoan Server/database/load/privilegios.dat' \copy privilegios_de_usuarios from '/work/eclipse-workspace/Canoan Server/database/load/privilegios_de_usuarios.dat' \copy classificacoes from '/work/eclipse-workspace/Canoan Server/database/load/classificacoes.dat' \copy tipo_de_produto from '/work/eclipse-workspace/Canoan Server/database/load/tipos.dat' This lines are OK. But when I remove the preceding backslash from them I ge= t the error that you mentioned. Harold A. Gim=C3=A9nez Ch. wrote: >=20 > Hi all, > In migrating an application from sql server to Postgres, I created a ruby > script that extracts csv files from sql server (from a windows box), then > SCPs them into a directory (/home/ruby_process) on the server running > Postgres (a Fedora core 8) and finally runs the Postgres COPY command for > each of the csv files. >=20 > When the script runs the COPY commnand, I get the following error (for th= e > genders table): >=20 > ERROR C42501 M could not open file "/home/ruby_process/genders.csv" > for > reading: Permission denied Fcopy.c L1694 RCopyFrom (RuntimeError) >=20 > My question is, what are the set of permissions required to perform a > postgres copy? >=20 > I've set the permissions on the directory so that the postgres group owns > the directory and has read and execute permissions, as follows: > drwxrwxr-x 3 ruby_process postgres >=20 > I have also tried moving the files to /tmp and performing the copy from > there, unsuccesfuly. >=20 > Any ideas would be appreciated. Thanks, > -Harold >=20 >=20 --=20 View this message in context: http://old.nabble.com/COPY-command-and-requir= ed-file-permissions-tp17800484p28976565.html Sent from the PostgreSQL - sql mailing list archive at Nabble.com.