Radicore Forum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » RADICORE development » Bug Reports » SQL error upon log in (PostgreSQL) (Select 1 subquery cannot compare to boolean in PostgreSQL)
SQL error upon log in (PostgreSQL) [message #4260] Mon, 16 June 2014 06:17 Go to next message
kong is currently offline  kong
Messages: 90
Registered: December 2011
Member
Upon log in, system produces
Fatal Error: PostgreSQL: ERROR: 42883: operator does not exist: integer = boolean LINE 9: WHERE ip_address_valid=true AND access_allowed=true ^ HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts. LOCATION: op_error, src\backend\parser\parse_oper.c:722 (# 42883)

SQL query: SELECT * FROM ( SELECT x.task_id, x.task_desc, x.script_id, x.pattern_id, mnu_nav_button.button_text, mnu_nav_button.context_preselect, (SELECT 1 FROM mnu_role_task WHERE task_id=mnu_nav_button.task_id_jnr AND role_id IN('H_GM') LIMIT 1) AS access_allowed, true AS ip_address_valid, mnu_nav_button.sort_seq FROM mnu_nav_button LEFT JOIN mnu_task ON (mnu_task.task_id = mnu_nav_button.task_id_snr) LEFT JOIN mnu_task AS x ON (x.task_id = mnu_nav_button.task_id_jnr) WHERE x.is_disabled='N' AND mnu_task.task_id='mnu_motd(show)' ) AS x WHERE ip_address_valid=true AND access_allowed=true ORDER BY sort_seq asc

Error in line 722 of file 'D:\Pet\PHP Full Env\UwAmp\www\radpg184\includes\dml.pgsql.class.inc'.
It appears that the subquery
(SELECT 1 FROM mnu_role_task WHERE task_id=mnu_nav_button.task_id_jnr AND role_id IN('H_GM') LIMIT 1) AS access_allowed
does not return a boolean value and in PostgreSQL cannot be compared to
true
A possible fix would be to use EXISTS and change the subquery to
EXISTS(SELECT 1 FROM mnu_role_task WHERE task_id=mnu_nav_button.task_id_jnr AND role_id IN('H_GM') LIMIT 1) AS access_allowed

[Updated on: Mon, 16 June 2014 06:19]

Report message to a moderator

Re: SQL error upon log in (PostgreSQL) [message #4275 is a reply to message #4260] Thu, 19 June 2014 05:03 Go to previous message
AJM is currently offline  AJM
Messages: 2367
Registered: April 2006
Location: Surrey, UK
Senior Member
Whoops! Embarassed

I've changed the code to test for 'Y' or 'N' instead of TRUE or FALSE. Changed scripts are in the attached zip file.


Previous Topic: Error after login (with Postgresql database)
Next Topic: Error update column to popup with Postgresql
Goto Forum:
  


Current Time: Fri Nov 15 16:28:27 EST 2024

Total time taken to generate the page: 0.01015 seconds