Re: chr(3) and 3::text

Поиск
Список
Период
Сортировка
От gmail Vladimir Koković
Тема Re: chr(3) and 3::text
Дата
Msg-id d9d33c64-2288-736a-78a8-15921255501b@gmail.com
обсуждение исходный текст
Ответ на Re: chr(3) and 3::text  ("David G. Johnston" <david.g.johnston@gmail.com>)
Ответы Re: chr(3) and 3::text  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список pgsql-novice

David,

Sorry for copy/paste error:replace(Filler,3::text,'') WRONG !

Character 0x03 is valid in ASCII and UTF-8 character sets.

Main question is, why is 3::text == '3' ?

On 28.3.20. 16:04, David G. Johnston wrote:
On Sat, Mar 28, 2020 at 6:21 AM gmail Vladimir Koković <vladimir.kokovic@gmail.com> wrote:


replace(Filler,chr(3),'') WORKS

replace(Filler3::text,'') WRONG

"Wrong" is not a helpful term unless you describe what you are expecting and how the result you got is different.  In particular just reading what you've typed the "wrong" one fails because you forgot the comma between "Fillter" and "3::text".  But I suspect you had a different unsaid expectation here.

In the future you should consider writing self-contained expressions, ideally ones that don't use physical tables if the problem permits.

David J.

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

Предыдущее
От: "David G. Johnston"
Дата:
Сообщение: Re: chr(3) and 3::text
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: chr(3) and 3::text