From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: Aniko.Badzong@swisscom.com
Cc: pgsql-sql@postgresql.org
Subject: Re: psql in the command line
Date: Wed, 25 Jan 2006 13:05:37 -0300
Message-ID: <20060125160537.GC2077@surnet.cl> (raw)
In-Reply-To: <E502FDA6FE0C5A4BB4EFA4250A1E049001DBE047@sxmbx51.corproot.net>
References: <E502FDA6FE0C5A4BB4EFA4250A1E049001DBE047@sxmbx51.corproot.net>
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)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: alvherre@alvh.no-ip.org, Aniko.Badzong@swisscom.com
Subject: Re: psql in the command line
In-Reply-To: <20060125160537.GC2077@surnet.cl>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox