X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id AC3A09DCA1C for ; Wed, 25 Jan 2006 12:02:52 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 06410-09 for ; Wed, 25 Jan 2006 12:02:50 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from alvh.no-ip.org (201-220-123-7.bk10-dsl.surnet.cl [201.220.123.7]) by postgresql.org (Postfix) with ESMTP id A546B9DCA29 for ; Wed, 25 Jan 2006 12:02:48 -0400 (AST) Received: by alvh.no-ip.org (Postfix, from userid 1000) id A185AC2DC59; Wed, 25 Jan 2006 13:05:37 -0300 (CLST) Date: Wed, 25 Jan 2006 13:05:37 -0300 From: Alvaro Herrera To: Aniko.Badzong@swisscom.com Cc: pgsql-sql@postgresql.org Subject: Re: psql in the command line Message-ID: <20060125160537.GC2077@surnet.cl> Mail-Followup-To: Aniko.Badzong@swisscom.com, pgsql-sql@postgresql.org References: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.11 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=1.786 required=5 tests=[AWL=-0.133, DNS_FROM_RFC_ABUSE=0.479, DNS_FROM_RFC_POST=1.44] X-Spam-Score: 1.786 X-Spam-Level: * X-Archive-Number: 200601/165 X-Sequence-Number: 23954 Aniko.Badzong@swisscom.com wrote: > test:/opt/pgsql# echo "copy test from '/data/log/bla';" | psql logdb > COPY > > But when I try to execute it as root user I get the following error: > > [est/data/log] su - postgres -c "echo 'copy test from /data/log/bla;'| > psql logdb" > ERROR: syntax error at or near "/" at character 16 > LINE 1: copy test from /data/log/bla; This is clearly not the same line. The quotes are not in the same position as in the line above. su - postgres -c "psql logdb -c 'copy test from \'data/log/bla\''" -- Alvaro Herrera http://www.advogato.org/person/alvherre "Es filósofo el que disfruta con los enigmas" (G. Coli)