Re: apostrophes and psql variables - Mailing list pgsql-general

From Q Beukes
Subject Re: apostrophes and psql variables
Date
Msg-id 44E8C880.20608@list.za.net
Whole thread Raw
In response to apostrophes and psql variables  ("Ilja Golshtein" <ilejn@yandex.ru>)
List pgsql-general
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

You must have missed one, because:

root=# \set tv1 '\'testval\''
root=# insert into test values(:tv1);
INSERT 0 1
root=#


Ilja Golshtein wrote:
> Hello!
>
> Is there any way to have psql variable in apostrophes?
>
> The idea is to do something like this
>
> \set var 'some value'
> insert into aaa values(:var)
>
> after substisution it should as simple as
> insert into aaa values('some value')
>
> I've tried all reasonable quotings
> I was able to make up but no any luck.
>
> Thanks.
>

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iQEVAwUBROjIerEDZDQ16UzTAQIVLAf/WFZVTRyc9s4tTh1BDel1OOOmJgak2ebJ
wYynHWxh2lrudyROybLS3Btbs98jnRsWZC7yNXCugkfDjZ7+n/paPFXcyCZIFqEr
akfHZXfRtkphD8IFrFCCsMIn68bU39CY+f/JtvyO1uIeSylolFDSfjOEh8jdPD6e
NciBURYj+q51Ugna63ym55zKmgSzISqdiDKzArtsfs7hYpzPo+8A4r/Ig7J6GsI9
3DON02eNaryYKdAdSJsnJWzLmhsgfp9oNI0X3V/fIcBV5w1SKgp/BsPYb/D7KbMI
XRmCglWQq8K4QzWjdaptLHbfuwmjRUuNMvzGs33VSZrjJywqqFcVcQ==
=yf0V
-----END PGP SIGNATURE-----


pgsql-general by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: Locale, encoding, sort order confusion
Next
From: John Gunther
Date:
Subject: Re: Locale, encoding, sort order confusion