Subject: Wired behaviour from SELECT

From: Arbol One <[email-masked]>
Date: Fri, 22 Nov 2024 20:07:10 +0000

Two different SELECT sql statement don't behave the same way.
The below sql statement produces the right output
SELECT nickname, password FROM password WHERE id='0938105618107N1';
  nickname   | password
-------------+----------
 Piccard@@21 |  Arbol
(1 row)
However, if this sql statement produces the wrong output
SELECT nickname, password FROM password WHERE nickname='Arbol';
 nickname | password
----------+----------
(0 rows)
What am I doing wrong?

---

From: "David G. Johnston" <[email-masked]>
Date: Fri, 22 Nov 2024 13:12:46 -0700

On Fri, Nov 22, 2024 at 1:07 PM Arbol One <[email-masked]> wrote:

> *SELECT nickname, password FROM password WHERE nickname='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 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.

---

From: Ron Johnson <[email-masked]>
Date: Fri, 22 Nov 2024 15:36:36 -0500

> SELECT nickname, password FROM password WHERE id='0938105618107N1';
Storing passwords in plain text is the Worst Possible Security Practice
Ever Conceived.

-- 
Death to <Redacted>, and butter sauce.
Don't boil me, I'm still alive.
<Redacted> lobster!

---

From: David Mullineux <[email-masked]>
Date: Fri, 22 Nov 2024 23:55:30 +0000

Instead of nickname you probably want tontet where password=`Arbol'  ..  or
am.i.missong something ?.

On Fri, 22 Nov 2024, 20:13 David G. Johnston, <[email-masked]>
wrote:

>> *SELECT nickname, password FROM password WHERE nickname='Arbol';
>>  nickname | password ----------+---------- (0 rows)*
>> What am I doing wrong?
>>

---

From: Arbol One <[email-masked]>
Date: Sat, 23 Nov 2024 04:47:48 -0500

Oops!
I am putting too many hours in front of the computer, better take a break 😳

On 2024-11-22 3:12 p.m., David G. Johnston wrote:
>     (0 rows)*
> 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.
>
-- 
*/ArbolOne ™/*
Using Fire Fox and Thunderbird.
ArbolOne is composed of students and volunteers dedicated to providing 
free services to charitable organizations.
ArbolOne's development on Java, PostgreSQL, HTML and Jakarta EE is in 
progress [ í ]