Thread: quoted variables in pgsql

quoted variables in pgsql

From
chester c young
Date:
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 


Re: quoted variables in pgsql

From
Tom Lane
Date:
chester c young <chestercyoung@yahoo.com> writes:
> cannot get those quotes around the value.

Use backslashes.

regression=# \set var '\'value\''
regression=# \echo :var
'value'
        regards, tom lane