Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1q9ZFS-0002Ni-Ms for pgsql-admin@arkaria.postgresql.org; Wed, 14 Jun 2023 22:45:54 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1q9ZFP-0003B8-Ht for pgsql-admin@arkaria.postgresql.org; Wed, 14 Jun 2023 22:45:51 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1q9ZFP-0003Az-7T for pgsql-admin@lists.postgresql.org; Wed, 14 Jun 2023 22:45:51 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1q9ZFH-002Pp4-GH for pgsql-admin@lists.postgresql.org; Wed, 14 Jun 2023 22:45:50 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 35EMjdB82018060; Wed, 14 Jun 2023 18:45:39 -0400 From: Tom Lane To: M Sarwar cc: Scott Ribe , "pgsql-admin@lists.postgresql.org" Subject: Re: The same result for with SPACE and without SPACE In-reply-to: References: Comments: In-reply-to M Sarwar message dated "Wed, 14 Jun 2023 22:31:34 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2018058.1686782739.1@sss.pgh.pa.us> Date: Wed, 14 Jun 2023 18:45:39 -0400 Message-ID: <2018059.1686782739@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk M Sarwar writes: > I expect this to behave the same way whether it comes from CHAR or VARCHAR. You expect incorrectly. CHAR comparison is insensitive to trailing spaces: https://www.postgresql.org/docs/current/datatype-character.html regards, tom lane