Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.92) (envelope-from ) id 1jID5u-0002hw-Ek for pgsql-novice@arkaria.postgresql.org; Sat, 28 Mar 2020 15:09:54 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1jID5t-0004fZ-1D for pgsql-novice@arkaria.postgresql.org; Sat, 28 Mar 2020 15:09:53 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1jID5s-0004fS-Mn for pgsql-novice@lists.postgresql.org; Sat, 28 Mar 2020 15:09:52 +0000 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jID5r-0000xI-B8 for pgsql-novice@postgresql.org; Sat, 28 Mar 2020 15:09:52 +0000 Received: by mail-wr1-x430.google.com with SMTP id 31so15315088wrs.3 for ; Sat, 28 Mar 2020 08:09:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language; bh=HkdYkvEEaoTUQU9uLKVOwKefDP1Z98dPfD+qy0dhLXk=; b=GTmrLcXU415oBaxq3tNir8nqiEok4n8C6/wwQJx/BCpEoxRKvkdEOwex6kf3OrYv8O iU2q5R6KPKCvrQ47QZeL8S4JPnd91Q57hCWnqKGO7ORQgkDbfF3gGk2r7Or3QGASijLD YmFdEajUK4n9D/pw6NmsAI9LdlanTWko7OFoXtpMRjS7U81bb+yyiyAqJwNWhITNBhQt 1JbU7+psOj1prwtBKCWBMrccPhX8tWk16l9Fc3Su7o5zjpgqlALklp3bt/nJFH5SHbJt IGt3V00EJJ01XziNBjVDh8EnOay1CvvmOvMAWJdlAMrmzRrY5Fp/Aai9BVkPaoCVnd8N lQhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language; bh=HkdYkvEEaoTUQU9uLKVOwKefDP1Z98dPfD+qy0dhLXk=; b=osbPP6ulDv/mFl6JFBkmwpl/efJCDxtZyhQPIR6t4qzuOdORiGf1Asgp7I02fT2yMi p46POsNnk57ry0Mq9iYcPbIxZk89O9lQdcRztP6J0L8/aldkL0QvA7Xg5zrQr1zmTaJh EH+GYCxq+bEe9SuxD/n3s1Clkdu26KUcGfYIZXi4BKTPLGuqOGZfajcSrWW6CuMXP2dZ I8KlNiSWVn8c3vaGN4hTv9zwt2c0k9/iCLZkTacg9j+JGmPFzSOnjoh7pNmvUd3PMV+S ileLOoffcwtOJLbyDrQMqh1cHLZbS2mCC/WVN3iNmWkaFO/sCyy5l/kA4seeLgBbXpsT EFgQ== X-Gm-Message-State: ANhLgQ2+JKX62ugp43YqS7ZEf1tytyEId5lEDt66Z5snSFB73Midj+hH a7ajYW+HKdLgJSxBToq3Oog= X-Google-Smtp-Source: ADFU+vs1dKgOkRqSsJQQokUw2+8Q3TD/MNA+GFQnijbMTEdVymLKj2eeewueKKr7/5W+fu/7MGiQTQ== X-Received: by 2002:a5d:4683:: with SMTP id u3mr5197801wrq.248.1585408189448; Sat, 28 Mar 2020 08:09:49 -0700 (PDT) Received: from [192.168.0.10] ([95.180.105.228]) by smtp.gmail.com with ESMTPSA id k3sm13260602wro.39.2020.03.28.08.09.48 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 28 Mar 2020 08:09:48 -0700 (PDT) Subject: Re: chr(3) and 3::text To: "David G. Johnston" Cc: pgsql-novice , Ken Benson References: <769c6f0f-62e1-bd7d-b3bc-221619ab4680@gmail.com> From: =?UTF-8?Q?gmail_Vladimir_Kokovi=c4=87?= Message-ID: Date: Sat, 28 Mar 2020 16:09:47 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/alternative; boundary="------------CD94DA6AD27C4315C64A7DD7" Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This is a multi-part message in MIME format. --------------CD94DA6AD27C4315C64A7DD7 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit 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ć > > 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. > --------------CD94DA6AD27C4315C64A7DD7 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit

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.

--------------CD94DA6AD27C4315C64A7DD7--