Re: [GENERAL] Escaping `psql --variable`

2012-05-29 Thread Alan Gutierrez
On Tue, May 29, 2012 at 05:19:49PM -0700, Jeff Davis wrote: > On Tue, 2012-05-29 at 18:32 -0400, Alan Gutierrez wrote: > > Surprised that this works: > > > > echo ":foo" | psql --variable foo="SELECT 1 AS FOO;" template1 > > > > Why doesn't `psql` escape parameters passed in through `--vari

Re: [GENERAL] Escaping `psql --variable`

2012-05-29 Thread Jeff Davis
On Tue, 2012-05-29 at 18:32 -0400, Alan Gutierrez wrote: > Surprised that this works: > > echo ":foo" | psql --variable foo="SELECT 1 AS FOO;" template1 > > Why doesn't `psql` escape parameters passed in through `--variable`. When I > use > a library in other languages, they will escape th

[GENERAL] Escaping `psql --variable`

2012-05-29 Thread Alan Gutierrez
Surprised that this works: echo ":foo" | psql --variable foo="SELECT 1 AS FOO;" template1 Why doesn't `psql` escape parameters passed in through `--variable`. When I use a library in other languages, they will escape the variable. How do I use `psql` from `bash` so that it will escape vari