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 1tEdV5-008hcP-Ts for pgsql-general@arkaria.postgresql.org; Fri, 22 Nov 2024 23:55:48 +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 1tEdV4-00DkDq-55 for pgsql-general@arkaria.postgresql.org; Fri, 22 Nov 2024 23:55:46 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tEdV3-00DkDb-Q7 for pgsql-general@lists.postgresql.org; Fri, 22 Nov 2024 23:55:45 +0000 Received: from mail-ot1-x32d.google.com ([2607:f8b0:4864:20::32d]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1tEdV0-003IEV-TC for pgsql-general@lists.postgresql.org; Fri, 22 Nov 2024 23:55:44 +0000 Received: by mail-ot1-x32d.google.com with SMTP id 46e09a7af769-7181c0730ddso1038495a34.2 for ; Fri, 22 Nov 2024 15:55:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1732319742; x=1732924542; 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=z5Tu45qiMq/ZtUeG8Qa5Id2wkh6PGxoaLK2SMwOPBOk=; b=nO06AkUTlWMS0S0s63+bqpjCS7GzvC+iFFcOAk4rVv1YWlAqbYHwQVREvSXQW81aLE 6hlNPBUO83BLwgueAbdQjZf/S+HxqoVzrV6hPx8o/oVQKCWj2Zd8yG24hYWSOXCY952G JbX70LH8NLEm4RDaoycZvPGuYIU78u1AGzN7+4HX/2DmBYPjh7iTLWIxkSwo02ekW7ol 4vJIyhkL6rCeS4nPURVTk1YzMkrB29UF7WSWT/L3YrSDQ3syNBGvvP1NMs7se/K0i3l+ jkVVAqaqXQ42UbUupxnb7oPZyrACMwDzxuMb1L0HEmfE2tqbG1FFtpgXn15MoxDzQZTC F/eg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732319742; x=1732924542; 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=z5Tu45qiMq/ZtUeG8Qa5Id2wkh6PGxoaLK2SMwOPBOk=; b=PAs1us6AN5PllSQ0rCG7IpmQBv2JcucsVYKNEbt7dBSkT4RV3xkcc1JMTfvn1U1UUu VUGc7ZPVKcNaP+k9/eQ1sRcR0UshBw40opwOeXO9yeSz5Ao45ig6CAt6FvgyE040BXis t5rxUz71X9dJdScznx51j94jJuLiw5LBwsuyZtJPe2cp5MdEwj4npKX6AuwNFJ1dObpY sQ7ubqnH+9xtZ+lqJfeZWjukyOgy0RwGl49Ik/e9iAO9YDuRbE0LoIfsgKHSmUGq/8KI 1XjYjJs4sb7ObSINUbEm0SUplJA5YpB241gqWZDwtzc/D6idhNufj5JNCKGih1w5Oxk0 opcw== X-Forwarded-Encrypted: i=1; AJvYcCXYLGNA5eiIYPVwTly5evIFap0lsxb8Vn7osujfhOpVyZIDakI7/ZXSfbUFQjc7AQVYVvH2ks5BTqX9d9gs@lists.postgresql.org X-Gm-Message-State: AOJu0Yz5eYhVpT5t/ccqoJEx8Zy0BdBCjxzyd7YS80HbC9FJtrhs50KD TgUWSTC8kQ64bOsPmcaJqiLWyuw7oZMV4cXrmkCt+uACORGxUh0qwQ598Xwb9SYJKnVRW6/RZ4I 2j9+cw13pprwZwsFvBEIW95KH0wU= X-Gm-Gg: ASbGnct/T3T/U2XQTFRGMUiZfOAkhznL6OtXl9GU5UOjGZbxRQokkBjUQe06UechEx5 NqqiuM+y50c/mNvreruC3J/dOqw4Ipm49 X-Google-Smtp-Source: AGHT+IHl5URoUvB7tJPM4BTbLivnPOunjxg+VSYnJE298MT0K8TpezzPUVPDxiF3q/yedMYFjEZEcMhsAWQ3NJwXWb8= X-Received: by 2002:a9d:65d0:0:b0:715:3f20:bd2c with SMTP id 46e09a7af769-71c04b8eebfmr4183890a34.10.1732319742197; Fri, 22 Nov 2024 15:55:42 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: David Mullineux Date: Fri, 22 Nov 2024 23:55:30 +0000 Message-ID: Subject: Re: Wired behaviour from SELECT To: "David G. Johnston" Cc: Arbol One , pgsql-general , PostGreSQL MailingList Content-Type: multipart/alternative; boundary="000000000000df07b90627891e43" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000df07b90627891e43 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Instead of nickname you probably want tontet where password=3D`Arbol' .. = or am.i.missong something ?. On Fri, 22 Nov 2024, 20:13 David G. Johnston, wrote: > On Fri, Nov 22, 2024 at 1:07=E2=80=AFPM Arbol One w= rote: > >> 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'; >> nickname | 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 sam= e > 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. > > --000000000000df07b90627891e43 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Instead of nickname you probably want tontet where passwo= rd=3D`Arbol'=C2=A0 ..=C2=A0 or am.i.missong something ?.

On Fri, 22 Nov = 2024, 20:13 David G. Johnston, <david.g.johnston@gmail.com> wrote:
On Fri, Nov 22, 2024 at 1:07=E2=80=AFPM Arbo= l 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.

--000000000000df07b90627891e43--