Re: Proper quoting of \e ?
| От | Joe Conway |
|---|---|
| Тема | Re: Proper quoting of \e ? |
| Дата | |
| Msg-id | 3CC82D65.9010809@joeconway.com обсуждение исходный текст |
| Ответ на | Proper quoting of \e ? (Helge Kreutzmann <kreutzm@itp.uni-hannover.de>) |
| Список | pgsql-sql |
Helge Kreutzmann wrote:
> Well, the "\" is part of the strings to be outputed, so I did not
> intend to quota anything. If I replace \ to \\ in my first query, I
> get also no result.
>
I think you need 4 '\'s:
test=# create table written_by(title text);
CREATE
test=# insert into written_by values('An equation of state {\\em \\\`a
la} Carnahan-Starling');
INSERT 16661 1
test=# select * from written_by; title
----------------------------------------------------- An equation of state {\em \`a la} Carnahan-Starling
(1 row)
test=# SELECT title from written_by where title like 'An equation of
state {\\\\e%'; title
----------------------------------------------------- An equation of state {\em \`a la} Carnahan-Starling
(1 row)
This is because the string literal parser reduces '\\\\' to '\\', and
then the backend function which implements LIKE interprets '\\' as '\'.
HTH,
Joe
В списке pgsql-sql по дате отправления: