pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feed(no subject)
3+ messages / 3 participants
[nested] [flat]
* (no subject)
@ 2006-01-26 08:52 Aniko.Badzong@swisscom.com
0 siblings, 2 replies; 3+ messages in thread
From: Aniko.Badzong@swisscom.com @ 2006-01-26 08:52 UTC (permalink / raw)
To: pgsql-admin
Hi
I have tried it yesterday to escaoe the double qutoes and I get the
error:
[test] su - postgres -c "echo \"copy test from '/data/log/bla';"\" |
psql logdb"
Unmatched ".
somehow does not want to work.
RE: [SQL] psql in the command line
from: Russell Simpkins [russellsimpkins@hotmail.com]
if in fact this works: echo "copy test from '/data/log/bla';" | psql
logdb
then you probably want to write it like this:
su - postgres -c "echo \"copy test from '/data/log/bla';\"|>psql logdb"
so that you escape the double quotes.
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re:
@ 2006-01-26 12:30 Alvaro Herrera <alvherre@alvh.no-ip.org>
parent: Aniko.Badzong@swisscom.com
1 sibling, 0 replies; 3+ messages in thread
From: Alvaro Herrera @ 2006-01-26 12:30 UTC (permalink / raw)
To: Aniko.Badzong@swisscom.com; +Cc: pgsql-admin
Aniko.Badzong@swisscom.com wrote:
> Hi
>
> I have tried it yesterday to escaoe the double qutoes and I get the
> error:
>
> [test] su - postgres -c "echo \"copy test from '/data/log/bla';"\" |
> psql logdb"
> Unmatched ".
You still don't fix it? I remembered yesterday that the shell doesn't
want escaped quotes inside a quoted argument, so you must quit the
quoted environment and put an escaped quote, something like
su - postgres -c "echo "\""copy test from '/data/log/bla';"\"" | pgsql logdb"
The echo-pipe is still overkill, you can do it using -c as I showed
yesterday by applying the same "trick".
--
Alvaro Herrera Valdivia, Chile ICBM: S 39º 49' 17.7", W 73º 14' 26.8"
"Es filósofo el que disfruta con los enigmas" (G. Coli)
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re:
@ 2006-01-26 15:06 Tom Lane <tgl@sss.pgh.pa.us>
parent: Aniko.Badzong@swisscom.com
1 sibling, 0 replies; 3+ messages in thread
From: Tom Lane @ 2006-01-26 15:06 UTC (permalink / raw)
To: Aniko.Badzong@swisscom.com; +Cc: pgsql-admin
<Aniko.Badzong@swisscom.com> writes:
> [test] su - postgres -c "echo \"copy test from '/data/log/bla';"\" |
> psql logdb"
> Unmatched ".
> somehow does not want to work.
You've got too many quote marks.
su - postgres -c "echo \"copy test from '/data/log/bla';\" | psql logdb"
regards, tom lane
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2006-01-26 15:06 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2006-01-26 08:52 Aniko.Badzong@swisscom.com
2006-01-26 12:30 ` Re: Alvaro Herrera <alvherre@alvh.no-ip.org>
2006-01-26 15:06 ` Re: Tom Lane <tgl@sss.pgh.pa.us>
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