Wired behaviour from SELECT

Started by Arbol Oneover 1 year ago6 messagesgeneral
Jump to latest
#1Arbol One
ArbolOne@hotmail.ca

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?

#2David G. Johnston
david.g.johnston@gmail.com
In reply to: Arbol One (#1)
Re: Wired behaviour from SELECT

On Fri, Nov 22, 2024 at 1:07 PM Arbol One <arbolone@hotmail.ca> wrote:

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?

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.

#3Ron
ronljohnsonjr@gmail.com
In reply to: Arbol One (#1)
Re: Wired behaviour from SELECT

On Fri, Nov 22, 2024 at 3:07 PM Arbol One <arbolone@hotmail.ca> wrote:

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)

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!

#4David Mullineux
dmullx@gmail.com
In reply to: David G. Johnston (#2)
Re: Wired behaviour from SELECT

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, <david.g.johnston@gmail.com>
wrote:

Show quoted text

On Fri, Nov 22, 2024 at 1:07 PM Arbol One <arbolone@hotmail.ca> wrote:

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?

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.

#5Arbol One
ArbolOne@hotmail.ca
In reply to: David G. Johnston (#2)
Re: Wired behaviour from SELECT

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:

On Fri, Nov 22, 2024 at 1:07 PM Arbol One <arbolone@hotmail.ca> wrote:

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?

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 [ í ]

#6Arbol One
ArbolOne@hotmail.ca
In reply to: Ron (#3)
Re: Wired behaviour from SELECT

Yes! Absolutely true. Thanks for the advice 🙂

On 2024-11-22 3:36 p.m., Ron Johnson wrote:

On Fri, Nov 22, 2024 at 3:07 PM Arbol One <arbolone@hotmail.ca> wrote:

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)

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!

--
*/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 [ í ]