pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Wetmore, Matthew (CTR) <Matthew.Wetmore@express-scripts.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
To: M Sarwar <sarwarmd02@outlook.com>
Cc: Scott Ribe <scott_ribe@elevated-dev.com>
Cc: pgsql-admin@lists.postgresql.org <pgsql-admin@lists.postgresql.org>
Subject: The same result for with SPACE and without SPACE
Date: Thu, 15 Jun 2023 13:08:06 +0000
Message-ID: <0055148e2cc742cbbc23485ae0c6c04e@express-scripts.com> (raw)
In-Reply-To: <2018059.1686782739@sss.pgh.pa.us>
References: <DM4PR19MB5978EB964FA1C7B55FFCB02DD35AA@DM4PR19MB5978.namprd19.prod.outlook.com>
	<DM4PR19MB59782360E0C452810D70CBE8D35AA@DM4PR19MB5978.namprd19.prod.outlook.com>
	<B600CCAA-59E5-4907-8E6D-C645CA24AB1D@elevated-dev.com>
	<DM4PR19MB59784B518F25D2C2292CA3FBD35AA@DM4PR19MB5978.namprd19.prod.outlook.com>
	<2018059.1686782739@sss.pgh.pa.us>

I can reproduce this with a INT

-----Original Message-----
From: Tom Lane <tgl@sss.pgh.pa.us> 
Sent: Wednesday, June 14, 2023 3:46 PM
To: M Sarwar <sarwarmd02@outlook.com>
Cc: Scott Ribe <scott_ribe@elevated-dev.com>; pgsql-admin@lists.postgresql.org
Subject: [EXTERNAL] Re: The same result for with SPACE and without SPACE

M Sarwar <sarwarmd02@outlook.com> 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://urldefense.com/v3/__https://www.postgresql.org/docs/current/datatype-character.html__;!!GFE8... 

			regards, tom lane







view thread (22+ messages)  latest in thread

Message-ID: <0055148e2cc742cbbc23485ae0c6c04e@express-scripts.com>
Permalink:  ../0055148e2cc742cbbc23485ae0c6c04e@express-scripts.com/
Also on:    postgresql.org/message-id/0055148e2cc742cbbc23485ae0c6c04e@express-scripts.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: Matthew.Wetmore@express-scripts.com, tgl@sss.pgh.pa.us, sarwarmd02@outlook.com, scott_ribe@elevated-dev.com, pgsql-admin@lists.postgresql.org
  Subject: Re: The same result for with SPACE and without SPACE
  In-Reply-To: <0055148e2cc742cbbc23485ae0c6c04e@express-scripts.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox