public inbox for [email protected]  
help / color / mirror / Atom feed
From: Wetmore, Matthew (CTR) <[email protected]>
To: mahesh <[email protected]>
To: Scott Ribe <[email protected]>
To: Mohammed Aslam <[email protected]>
To: [email protected] <[email protected]>
Cc: Tom Lane <[email protected]>
Cc: M Sarwar <[email protected]>
Subject: The same result for with SPACE and without SPACE
Date: Thu, 15 Jun 2023 15:21:56 +0000
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <DM4PR19MB5978EB964FA1C7B55FFCB02DD35AA@DM4PR19MB5978.namprd19.prod.outlook.com>
	<DM4PR19MB59782360E0C452810D70CBE8D35AA@DM4PR19MB5978.namprd19.prod.outlook.com>
	<[email protected]>
	<DM4PR19MB59784B518F25D2C2292CA3FBD35AA@DM4PR19MB5978.namprd19.prod.outlook.com>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<CAJXhg9ByRV9QPVcW5MPi2c20g948Oxt8qU1DrcVb51fFgTEj2A@mail.gmail.com>
	<[email protected]>

Before you kick me out of the group, can you please explain.

I thought the orig issue was that purposefully spaces/whitespace are being ignored (or not ignored.) in the select.  Maybe there was an email in the middle that I missed.

create table matt_test (c1 int)

insert into matt_test  values ('123')

insert into matt_test  values (' 123')

insert into matt_test values ('123 ')

select c1 from matt_test where c1 = '123'
-- all 3 rows returned.

Is it expected behavior that all 3 rows would be returned (because the space isn’t an INT?)

Works as I would expect with TEXT

create table matt_test2 (c2 text)

insert into matt_test2  values ('123')

insert into matt_test2  values (' 123')

insert into matt_test2  values ('123 ')

select c2 from matt_test2 where c2 = '123'
-- 1 rows returned.


From: mahesh <[email protected]>
Sent: Thursday, June 15, 2023 7:12 AM
To: Scott Ribe <[email protected]>; Mohammed Aslam <[email protected]>; [email protected]
Cc: Wetmore, Matthew (CTR) <[email protected]>; Tom Lane <[email protected]>; M Sarwar <[email protected]>
Subject: [EXTERNAL] Re: The same result for with SPACE and without SPACE

Kindly remove from from the group..

On Thursday, June 15, 2023 at 08:44:58 AM CDT, Mohammed Aslam <[email protected]<mailto:[email protected]>> wrote:


Kindly remove from here

On Thu, 15 Jun, 2023, 7:09 pm Scott Ribe, <[email protected]<mailto:[email protected]>> wrote:
> On Jun 15, 2023, at 7:08 AM, Wetmore, Matthew (CTR) <[email protected]<mailto:[email protected]>> wrote:
>
> I can reproduce this with a INT

?

When casting string to integer, trailing spaces do not cause an exception. When casting integer to char(n), the string will be blank padded.


view thread (22+ messages)  latest in thread

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: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
  Subject: Re: The same result for with SPACE and without SPACE
  In-Reply-To: <[email protected]>

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

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