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 1q9pKx-0003Mh-UJ for pgsql-admin@arkaria.postgresql.org; Thu, 15 Jun 2023 15:56:40 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1q9pKw-0001Lq-SN for pgsql-admin@arkaria.postgresql.org; Thu, 15 Jun 2023 15:56:38 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1q9pHy-0008B1-8F for pgsql-admin@lists.postgresql.org; Thu, 15 Jun 2023 15:53:34 +0000 Received: from mail-lj1-x22b.google.com ([2a00:1450:4864:20::22b]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1q9pHv-002NAE-UQ for pgsql-admin@lists.postgresql.org; Thu, 15 Jun 2023 15:53:33 +0000 Received: by mail-lj1-x22b.google.com with SMTP id 38308e7fff4ca-2b3451b3ea9so31518851fa.1 for ; Thu, 15 Jun 2023 08:53:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686844410; x=1689436410; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=+V9RQAzXivAjdH1ImeOM4AAm6Cjt22ZCxAHSbpFtui8=; b=E17NKcK8VE5QMsZOUNggzySVul+nX9QkuDfUm9++Ns2nu3a7ZXsEBmRWq1o7nrHN/k RLwPyZsT9RtJsyOXemyNaWOBw80qpF8IZmTClwdSvBQU9FQUE+/oWWvKmKWSdOT5SAKU DIye84g+1eT/V4sW9Q1N4hkQorReeMatV4ZTIh+qSmSMiCHbj/lFYHEg4sx5pxEiF/J5 9gavrstApdqJpY24DNGWB4DzvddcxzdQ9ZclPTmNdH0hpuahQPXosBCASwE2jIetYEAn HAPnuHM1iY40cM7C4y47zkIvKmMsmrahnk1AH5c6aN9rVaaRlax8Q37tvEUhnXdb3HoR Z9VA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686844410; x=1689436410; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=+V9RQAzXivAjdH1ImeOM4AAm6Cjt22ZCxAHSbpFtui8=; b=Ok7i/k/hxKlZw8fGvbH7WcDB4y5tAjyIRKFKOzF0RRf9bBF0TwCV2Qdo0KttI+f9Cg 8H4Rrarpi2lnJuy6Bzcn1kITTG69OOX8vp2KaMuFhaoidk9u0FlCQtDckOAf/SoYbtTl jyryuiQplFwGrU8lR9A0f4Lea86QWsDRdAnRJMS7P43o7WPSdgYwNo76O0Voju+AOt+x IJ8dHYtBvBR+IqMU1xwWoDzfFjCCQ7Qdiyibu2CmkcT26+y7L+fF/l0e9mgb/d6SFGZS JZdhR9jrf8iwZSDae8clNKRF73oeeYIEwidDIRKZxq4qjAoe6xGJv/Vt4AoNh/Dkzij7 zH2Q== X-Gm-Message-State: AC+VfDwi9yjAuzhaRE0iz9cuOPK3wWrRAB0Da9NSWBIPldne42N2ElE2 eRrI2zxYVPek40ocTwwwcNIQlEUZ8dFGfjLytLM= X-Google-Smtp-Source: ACHHUZ4o3JpFH8j2C8ktG0JhnJvEDiXkUd5KFPCZlRdlW0tJo4yHZuX2zq9kULzwsDbo48FTthhp/dFwDQ0u4BKKCX4= X-Received: by 2002:a2e:868b:0:b0:2b1:c783:b905 with SMTP id l11-20020a2e868b000000b002b1c783b905mr8797500lji.15.1686844409807; Thu, 15 Jun 2023 08:53:29 -0700 (PDT) MIME-Version: 1.0 References: <2018059.1686782739@sss.pgh.pa.us> <0055148e2cc742cbbc23485ae0c6c04e@express-scripts.com> <2CAFD37D-68FC-4A01-BE65-FAF1ADF7A60A@elevated-dev.com> <1726236757.407336.1686838293703@mail.yahoo.com> <3f21240f59a54f96898886f2c9189cf3@express-scripts.com> In-Reply-To: <3f21240f59a54f96898886f2c9189cf3@express-scripts.com> From: "David G. Johnston" Date: Thu, 15 Jun 2023 08:53:20 -0700 Message-ID: Subject: Re: The same result for with SPACE and without SPACE To: "Wetmore, Matthew (CTR)" Cc: mahesh , Scott Ribe , Mohammed Aslam , pgsql-admin@lists.postgresql.org, Tom Lane , M Sarwar Content-Type: multipart/alternative; boundary="000000000000d687d405fe2d1117" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000d687d405fe2d1117 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Jun 15, 2023, 08:22 Wetmore, Matthew (CTR) < Matthew.Wetmore@express-scripts.com> wrote: > Before you kick me out of the group, can you please explain. > > > > I thought the orig issue was that purposefully spaces/whitespace are bein= g > 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 =3D '123' > > -- all 3 rows returned. > > > > Is it expected behavior that all 3 rows would be returned (because the > space isn=E2=80=99t 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 =3D '123' > > -- 1 rows returned. > > If anything the inserts themselves should fail in trying to parse the string to integers. But that works just fine so all three rows have the same integer output for the different inputs. David J. > --000000000000d687d405fe2d1117 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Thu, Jun 15, 2023, 08:22 Wetmore, Matthew = (CTR) <Matthew.We= tmore@express-scripts.com> wrote:

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

=C2=A0

I thought the orig issue was that pur= posefully spaces/whitespace are being ignored (or not ignored.) in the sele= ct.=C2=A0 Maybe there was an email in the middle that I missed.

=C2=A0

create table matt_test (c1 int)

=C2=A0

insert into matt_test=C2=A0 values (&= #39;123')

=C2=A0

insert into matt_test=C2=A0 values (&= #39; 123')

=C2=A0

insert into matt_test values ('12= 3 ')

=C2=A0

select c1 from matt_test where c1 =3D= '123'

-- all 3 rows returned.=

=C2=A0

Is it expected behavior that all 3 ro= ws would be returned (because the space isn=E2=80=99t an INT?)

=C2=A0

Works as I would expect with TEXT<= /u>

=C2=A0

create table matt_test2 (c2 text)<= /u>

=C2=A0

insert into matt_test2=C2=A0 values (= '123')

=C2=A0

insert into matt_test2=C2=A0 values (= ' 123')

=C2=A0

insert into matt_test2=C2=A0 values (= '123 ')

=C2=A0

select c2 from matt_test2 where c2 = =3D '123'

-- 1 rows returned.


If anything the inserts themselves should fail= in trying to parse the string to integers.=C2=A0 But that works just fine = so all three rows have the same integer output for the different inputs.

David J.
--000000000000d687d405fe2d1117--