string function -- replace needs a clear doc - Mailing list pgsql-sql

From Jie Liang
Subject string function -- replace needs a clear doc
Date
Msg-id E7E213858379814A9AE48CA6754F5ECB36321B@mail01.stbernard.com
Whole thread Raw
Responses Re: [ADMIN] string function -- replace needs a clear doc  (Stephan Szabo <sszabo@megazone.bigpanda.com>)
Re: string function -- replace needs a clear doc  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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 by date:

Previous
From: Franco Bruno Borghesi
Date:
Subject: Re: possible?
Next
From: Stephan Szabo
Date:
Subject: Re: [ADMIN] string function -- replace needs a clear doc