[SQL] quoted variables in pgsql

2007-01-04 Thread chester c young
cannot figure this out

# \set var 'value'
# select * from some_table where some_col = :var;
ERROR: column value does not exist

cannot get those quotes around the value.  tried:
# \set var ''value''
# \set var value

in each case:
# \echo :var
value

thanks

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---(end of broadcast)---
TIP 4: Have you searched our list archives?

   http://archives.postgresql.org


Re: [SQL] quoted variables in pgsql

2007-01-04 Thread Tom Lane
chester c young <[EMAIL PROTECTED]> writes:
> cannot get those quotes around the value.

Use backslashes.

regression=# \set var '\'value\''
regression=# \echo :var
'value'

regards, tom lane

---(end of broadcast)---
TIP 7: You can help support the PostgreSQL project by donating at

http://www.postgresql.org/about/donate