public inbox for [email protected]help / color / mirror / Atom feed
Wired behaviour from SELECT 5+ messages / 5 participants [nested] [flat]
* Wired behaviour from SELECT @ 2024-11-22 20:07 Arbol One <[email protected]> 0 siblings, 2 replies; 5+ messages in thread From: Arbol One @ 2024-11-22 20:07 UTC (permalink / raw) To: [email protected] <[email protected]>; pgsql-general 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? ^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: Wired behaviour from SELECT @ 2024-11-22 20:12 David G. Johnston <[email protected]> parent: Arbol One <[email protected]> 1 sibling, 2 replies; 5+ messages in thread From: David G. Johnston @ 2024-11-22 20:12 UTC (permalink / raw) To: Arbol One <[email protected]>; +Cc: [email protected] <[email protected]>; pgsql-general On Fri, Nov 22, 2024 at 1:07 PM Arbol One <[email protected]> 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. ^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: Wired behaviour from SELECT @ 2024-11-22 20:36 Ron Johnson <[email protected]> parent: Arbol One <[email protected]> 1 sibling, 0 replies; 5+ messages in thread From: Ron Johnson @ 2024-11-22 20:36 UTC (permalink / raw) To: pgsql-general On Fri, Nov 22, 2024 at 3:07 PM Arbol One <[email protected]> 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! ^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: Wired behaviour from SELECT @ 2024-11-22 23:55 David Mullineux <[email protected]> parent: David G. Johnston <[email protected]> 1 sibling, 0 replies; 5+ messages in thread From: David Mullineux @ 2024-11-22 23:55 UTC (permalink / raw) To: David G. Johnston <[email protected]>; +Cc: Arbol One <[email protected]>; pgsql-general <[email protected]>; pgsql-general 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 protected]> wrote: > On Fri, Nov 22, 2024 at 1:07 PM Arbol One <[email protected]> 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. > > ^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: Wired behaviour from SELECT @ 2024-11-23 09:47 Arbol One <[email protected]> parent: David G. Johnston <[email protected]> 1 sibling, 0 replies; 5+ messages in thread From: Arbol One @ 2024-11-23 09:47 UTC (permalink / raw) To: pgsql-general; [email protected] <[email protected]>; +Cc: David G. Johnston <[email protected]> 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 <[email protected]> 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 [ í ] ^ permalink raw reply [nested|flat] 5+ messages in thread
end of thread, other threads:[~2024-11-23 09:47 UTC | newest] Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2024-11-22 20:07 Wired behaviour from SELECT Arbol One <[email protected]> 2024-11-22 20:12 ` David G. Johnston <[email protected]> 2024-11-22 23:55 ` David Mullineux <[email protected]> 2024-11-23 09:47 ` Arbol One <[email protected]> 2024-11-22 20:36 ` Ron Johnson <[email protected]>
This inbox is served by agora; see mirroring instructions for how to clone and mirror all data and code used for this inbox