X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id F38FBD9161 for ; Fri, 23 Sep 2005 10:47:10 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 69025-08 for ; Fri, 23 Sep 2005 13:47:02 +0000 (GMT) Received: from tigger.fuhr.org (tigger.fuhr.org [63.214.45.158]) by svr1.postgresql.org (Postfix) with ESMTP id 86F66D914E for ; Fri, 23 Sep 2005 10:47:04 -0300 (ADT) Received: from winnie.fuhr.org (winnie.fuhr.org [10.1.0.1]) by tigger.fuhr.org (8.13.3/8.13.3) with ESMTP id j8NDl4vx058396 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 23 Sep 2005 07:47:06 -0600 (MDT) (envelope-from mfuhr@winnie.fuhr.org) Received: from winnie.fuhr.org (localhost [127.0.0.1]) by winnie.fuhr.org (8.13.3/8.13.3) with ESMTP id j8NDl49t073096; Fri, 23 Sep 2005 07:47:04 -0600 (MDT) (envelope-from mfuhr@winnie.fuhr.org) Received: (from mfuhr@localhost) by winnie.fuhr.org (8.13.3/8.13.3/Submit) id j8NDl3dc073095; Fri, 23 Sep 2005 07:47:03 -0600 (MDT) (envelope-from mfuhr) Date: Fri, 23 Sep 2005 07:47:03 -0600 From: Michael Fuhr To: =?iso-8859-1?Q?C=E9dric?= Buschini Cc: pgsql-admin@postgresql.org Subject: Re: COPY TO / COPY FROM Message-ID: <20050923134703.GA73062@winnie.fuhr.org> References: <4333EB91.7020909@carax.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <4333EB91.7020909@carax.com> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.298 required=5 tests=[AWL=-0.288, HOT_NASTY=0.586] X-Spam-Level: X-Archive-Number: 200509/270 X-Sequence-Number: 19007 On Fri, Sep 23, 2005 at 01:48:33PM +0200, Cédric Buschini wrote: > ===================== > psql -h192.168.XXX.XXX -dDATABASE -Upostgres << EOF > /home/postgres/FILE > COPY TABLE TO stdout; > EOF > > psql -h192.168.XXX.XXX -dDATABASE -Upostgres << EOF > COPY carax_exec_bck FROM '/home/postgres/FILE'; > EOF > ======================= > > I got this error : > ERROR: could not open file "/home/postgres/FILE" for reading: No such > file or directory Are the client and server on the same machine? The use of the -h option suggests perhaps not. In the first command you're redirecting psql's output to a file on the client machine, and in the second command you're trying to read a file on the server machine. -- Michael Fuhr