Обсуждение: FW: copy command

Поиск
Список
Период
Сортировка

FW: copy command

От
Дата:


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.

Re: FW: copy command

От
Stef
Дата:
Aniko.Badzong@swisscom.com mentioned :
=>
=>
=> > 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.

su - postgres -c "echo \"copy test from '/data/log/bla';\" | psql logdb "

--
Confidentiality Notice:

The above message and all attachments may contain privileged and
confidential information intended only for the person or entity to which it
is addressed. Any review, retransmission, dissemination, copy or other use
of, or taking of any action in reliance upon this information by persons or
entities other than the intended recipient is prohibited. If you received
this message in error, please notify the sender immediately by e-mail,
facsimile or telephone and thereafter delete the material from your
computer. Any views expressed in this message are those of the individual
sender, except where the sender specifically states them to be the view of
the entity transmitting the message. UCS Group Limited and all of its
subsidiary companies hereby distances itself from and accepts no liability
in respect of the unauthorized use of its e-mail facility or the sending of
e-mail communications for other than strictly business purposes