string function -- replace needs a clear doc

Поиск
Список
Период
Сортировка
От Jie Liang
Тема string function -- replace needs a clear doc
Дата
Msg-id E7E213858379814A9AE48CA6754F5ECB36321B@mail01.stbernard.com
обсуждение исходный текст
Ответы Re: [ADMIN] string function -- replace needs a clear doc
Re: string function -- replace needs a clear doc
Список pgsql-sql
urldb=# select replace('whateveritis','a','A');
   replace
--------------
 whAteveritis
(1 row)

urldb=# select replace('whateveritis','e','E');
   replace
--------------
 whatEvEritis
(1 row)

urldb=# select replace('whatever%20itis','e','E');
             replace
---------------------------------
 whatEvEr                   1tis
(1 row)

urldb=# select replace('whatever%%20itis','e','E');
     replace
-----------------
 whatEvEr%20itis
(1 row)

urldb=# select replace('whatever%%20sitis','e','E');
     replace
------------------
 whatEvEr%20sitis
(1 row)

urldb=# select replace('whatever%20sitis','e','E');
server closed the connection unexpectedly
        This probably means the server terminated abnormally
        before or while processing the request.
The connection to the server was lost. Attempting reset: Failed.
!#
> psql urldb
Welcome to psql 7.3.2, the PostgreSQL interactive terminal.

Type:  \copyright for distribution terms
       \h for help with SQL commands
       \? for help on internal slash commands
       \g or terminate with semicolon to execute query
       \q to quit

urldb=# select replace('whatever%20sitis','si','SI');
    replace
---------------
 whateverSItis
(1 row)

1. No doc said % should escape by %%, and
select replace('whatever%20sites','%20','%%20') won't work also.
2. v7.3.2 haven't resolved this problem yet, I am not sure the later version.


Jie Liang

В списке pgsql-sql по дате отправления:

Предыдущее
От: Franco Bruno Borghesi
Дата:
Сообщение: Re: possible?
Следующее
От: Stephan Szabo
Дата:
Сообщение: Re: [ADMIN] string function -- replace needs a clear doc