RE: chr(3) and 3::text

From: Ken Benson <Ken(at)infowerks(dot)com>
To: gmail Vladimir Koković <vladimir(dot)kokovic(at)gmail(dot)com>, "pgsql-novice(at)postgresql(dot)org" <pgsql-novice(at)postgresql(dot)org>
Subject: RE: chr(3) and 3::text
Date: 2020-03-28 14:39:09
Message-ID: MWHPR19MB1054A179D3436FD679311CE4A3CD0@MWHPR19MB1054.namprd19.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

From: gmail Vladimir Koković <vladimir(dot)kokovic(at)gmail(dot)com>
Sent: Saturday, March 28, 2020 6:39 AM
To: Ken Benson <Ken(at)infowerks(dot)com>; pgsql-novice(at)postgresql(dot)org
Subject: Re: chr(3) and 3::text

OK,

And what is 3::text ?

[Ken Benson] that means convert the numeric value “3” to a text data type … similar to CAST(NumericValue as text) in MSSQL

On 28.3.20. 14:35, Ken Benson wrote:

From: gmail Vladimir Koković <vladimir(dot)kokovic(at)gmail(dot)com><mailto:vladimir(dot)kokovic(at)gmail(dot)com>
Sent: Saturday, March 28, 2020 6:22 AM
To: pgsql-novice(at)postgresql(dot)org<mailto:pgsql-novice(at)postgresql(dot)org>
Subject: chr(3) and 3::text

Hi,

Why is chr(3) is different than 3::text ?

[Ken Benson] Chr(3) – means return the character that has the ASCII code of “3” – which is a control character.

https://w3resource.com/PostgreSQL/chr-function.php

Examples:

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

replace(Filler3::text,'') WRONG

Vladimir Kokovic, DP senior (69)
Serbia, Belgrade, March 28, 2020

Ken Benson | ken @ infowerks-dot-com

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message David G. Johnston 2020-03-28 14:57:50 Re: chr(3) and 3::text
Previous Message gmail Vladimir Koković 2020-03-28 13:38:48 Re: chr(3) and 3::text