\set a multılıne varıable

Started by samıabout 19 years ago2 messagesgeneral
Jump to latest
#1samı
sami.jan@gmail.com

How do you set a multılıne varıable usıng psql ?

eg I am tryıng to add a multılıne varıable: somethıng on the lınes
of :

\set ADD_REMOTE_LINK 'SELECT '
' name from '
' mytable'

and then call ıt usıng

\echo :ADD_REMOTE_LINK

Addıng a \ at the end of the lıne does not help - I am not sure what
do to - the psql documentatıon ıs not help eıther ( or maybe I may
have mıssed ıt)

Thanks

Samı

#2Peter Eisentraut
peter_e@gmx.net
In reply to: samı (#1)
Re: \set a multılıne varıable

samı wrote:

How do you set a multılıne varıable usıng psql ?

peter=# \set foo 'abc\ndef'
peter=# \echo :foo
abc
def

--
Peter Eisentraut
http://developer.postgresql.org/~petere/