public inbox for [email protected]  
help / color / mirror / Atom feed
From: M Sarwar <[email protected]>
To: [email protected] <[email protected]>
Subject: The same result for with SPACE and without SPACE
Date: Wed, 14 Jun 2023 21:51:06 +0000
Message-ID: <DM4PR19MB59782360E0C452810D70CBE8D35AA@DM4PR19MB5978.namprd19.prod.outlook.com> (raw)
In-Reply-To: <DM4PR19MB5978EB964FA1C7B55FFCB02DD35AA@DM4PR19MB5978.namprd19.prod.outlook.com>
References: <DM4PR19MB5978EB964FA1C7B55FFCB02DD35AA@DM4PR19MB5978.namprd19.prod.outlook.com>

Postgres: PostgreSQL 13.7 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 7.3.1 20180712 (Red Hat 7.3.1-12), 64-bit
Cloud: AWS RDS
pgAdmin: 4

SQL-1:-     with SPACE in WHERE clause
select * from  BRONX.TEST_TEST_DETAILS_ALL_MCM where test_number = 'TEST4P20 ';

Result-1:
747   "AB                                                "  "TEST4P20  "      " Max "     " IIH 1.8V Max "  "uA                  "  -405.000000 405.000000  "2023-06-14 01:12:17.714181+00"     
836   "AB                                                "  "TEST4P20  "      "Max" "IIH 1.8V Max"    "uA                  "  -405.000000 405.000000  "2023-06-14 01:13:17.869917+00"     
906   "BI                                                "  "TEST4P20  "      "PS16 Current (V7)"     "2.2V I DUT1-4"   "A                   "  0.001000    100.000000  "2023-06-14 01:14:04.95952+00"      

SQL-2:- without SPACE in WHERE clause
select * from  BRONX.TEST_TEST_DETAILS_ALL_MCM where test_number = 'TEST4P20';

Result-2:
747   "AB                                                "  "TEST4P20  "      " Max "     " IIH 1.8V Max "  "uA                  "  -405.000000 405.000000  "2023-06-14 01:12:17.714181+00"           "AMB"
836   "AB                                                "  "TEST4P20  "      "Max" "IIH 1.8V Max"    "uA                  "  -405.000000 405.000000  "2023-06-14 01:13:17.869917+00"           "HOT"
906   "BI                                                "  "TEST4P20  "      "PS16 Current (V7)"     "2.2V I DUT1-4"   "A                   "  0.001000    100.000000  "2023-06-14 01:14:04.95952+00"        

Please note in SQL-1 that test_number = 'TEST4P20 ' has a space and in SQL-2 there is no space test_number = 'TEST4P20' has no space.

Is it not a bug?
I do not want the above queries to fetch the same results.
I check the data closely which does has a SPACE in the table. In which case, SQL-2 should have fetched no rows.
Does anyone not agree on this?


Thanks,
Sarwar
From Greenbelt in Maryland!




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]
  Subject: Re: The same result for with SPACE and without SPACE
  In-Reply-To: <DM4PR19MB59782360E0C452810D70CBE8D35AA@DM4PR19MB5978.namprd19.prod.outlook.com>

* 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