Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tEa1w-008MZS-Ii for pgsql-general@arkaria.postgresql.org; Fri, 22 Nov 2024 20:13:28 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tEa1v-00BxQC-1a for pgsql-general@arkaria.postgresql.org; Fri, 22 Nov 2024 20:13:27 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tEa1u-00BxPx-Mw for pgsql-general@lists.postgresql.org; Fri, 22 Nov 2024 20:13:26 +0000 Received: from mail-oa1-x2e.google.com ([2001:4860:4864:20::2e]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1tEa1s-003Ks2-FA for pgsql-general@lists.postgresql.org; Fri, 22 Nov 2024 20:13:26 +0000 Received: by mail-oa1-x2e.google.com with SMTP id 586e51a60fabf-2974274180aso17142fac.0 for ; Fri, 22 Nov 2024 12:13:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1732306402; x=1732911202; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=tfItnKHwVn6QmSDH4mHUbuMeLoN63CY7Ygg2L2NfHgg=; b=ez3fMffv2dFZ/Mn+AD3KrWlRxEY0i7K7rZ8Ax9b3g1/M0H4eiKfqoETvulXjfQ/VTq 1prcHY91U0GhG9Mpu4JkWgxYPbXL2E9BU25n0vx0d1R5rDV2EMqm5C4jApY6JOj0y0El cLnuwiULgNBGsut3iep7ANo/UbOQQAs9u8znp5V68B4l1GTdc6K4YV9+SHP2VyLlEseF /bP4IBj8nC1RFPUgKaED0iavQTvxhmxaeE3PzfvHCdEoQ2OYLpcmYAunOySL8pbELgN2 I7q75E7CbL2tg2VwAltH8rD3fn2ezpT8h4iDNvOTk/Ppe5VTSjJv7Y6n2mV2iMwt3hUE s9uA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732306402; x=1732911202; 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=tfItnKHwVn6QmSDH4mHUbuMeLoN63CY7Ygg2L2NfHgg=; b=Tf2pdc6uYJUE1sQlGazlpZCXsUPD6Q/60xsXsxdVKCm50VyfkWj/93JKw4uSv6YH4d sMh98z6tiEeJ/uNmHm8C2wz5Qum2JBXB9FMxhyBDsYXBkLtaFSQEDLYDrxheNGjTGQv3 dR4j9g4ubFqgsZw2+8/XQd6oMbPtmZaf1Qv5tXmZ7XwqWG2JoEaOCn4DHHaMQf4/kyXo pCkDgQF8LXxwQz6p3dm0YAK0Ns1OfIogR98Ba+el5nqbn11EitOlayY+kcMwBiFKf3/+ rCsjAYoTFNzj5B2bxuXzQA1Swu3xUUke5i8psrvES0LwZti5AE/D7iSQDLgO0mQs61l7 FvYg== X-Gm-Message-State: AOJu0YyWGr3RMV/ttdrl0oVSKInWFuCOVjRp1BzH/TijOLFHa54/g6uR SQtGByw8hVyE2UrDWuruMSyNPjip1BDWJcmarlysixj5oqGWcVWZdUsZ627vj+NA8nTk/EhfA21 c2EaM9v8sdnYsNWF30VykBXt0ay/9AcXr X-Gm-Gg: ASbGncu7kC6NLnys804dV0SkeGWN8tQHpxr2L8T63QxafXBmL7JeOH0rOO7BGe+KruB G/Fxfh9chUgqGcg9jg6VkIUbm0TO7X7k= X-Google-Smtp-Source: AGHT+IHSRbwgy35JHlhwYkCnRc685FgeLpzZbwsr3hueVjZO2vWRK7+9WKhFCvBtJlw0lOefzWoGpRNkIzoEs51lkvQ= X-Received: by 2002:a05:6870:6b0d:b0:287:a1e:a37c with SMTP id 586e51a60fabf-29720ea3ca4mr4933823fac.40.1732306402099; Fri, 22 Nov 2024 12:13:22 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: "David G. Johnston" Date: Fri, 22 Nov 2024 13:12:46 -0700 Message-ID: Subject: Re: Wired behaviour from SELECT To: Arbol One Cc: "pgsql-general@lists.postgresql.org" , PostGreSQL MailingList Content-Type: multipart/alternative; boundary="000000000000bd4d010627860382" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000bd4d010627860382 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Nov 22, 2024 at 1:07=E2=80=AFPM Arbol One wro= te: > The below sql statement produces the right output > SELECT nickname, password FROM password WHERE id=3D'0938105618107N1'; > nickname | password > -------------+---------- > Piccard@@21 | Arbol > (1 row) > However, if this sql statement produces the wrong output > > > > *SELECT nickname, password FROM password WHERE nickname=3D'Arbol'; nickn= ame > | password ----------+---------- (0 rows)* > What am I doing wrong? > Naming a column in your table the same name as the table is problematic generally. As for the query, if they are both intended to return the same row the value Arbol is in the password column, not the nickname column. You seem to have reversed the data for the two columns. David J. --000000000000bd4d010627860382 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Fri, Nov 22, 2024 at 1:07=E2=80=AFPM Arbol One <arbolone@hotmail.ca> wrote:
The below sql statement produce= s the right output
However, if this sql statement produces the wrong output
SELECT nickname, password FROM password WHERE nickname=3D'Arbol'= ;
=C2=A0nickname | password
----------+----------
(0 rows)
What am I doing wrong?
Naming a column in = your table the same name as the table is problematic generally.=C2=A0 As fo= r the query, if they are both intended to return the same row the value Arb= ol is in the password column, not the nickname column.=C2=A0 You seem to ha= ve reversed the data for the two columns.

David J.

--000000000000bd4d010627860382--