On Thu, 23 Oct 2008 18:46:34 +0200, Viraj Kanwade <virajk(at)gslab(dot)com> wrote:
> psql -d mydb -U usr -t -c " select val1 from ""MyTable"" where val2 =
> 'abc' "
> OR
> psql -d mydb -U usr -t -c ' select val1 from "MyTable" where val2 =
> ''abc'' '
>
> Both work fine on my windows machine.
This is completely not PostgreSQL related.
That's shell scripting/escaping problem.
Try that:
psql -d mydb -U usr -t -c 'select val1 from "MyTable" where val2 =
'"'"'abc'"'" (eww)
or
psql -d mydb -U usr -t -c "select val1 from \"MyTable\" where val2 =
'abc'" (seems better)
--
ru