Thank you very much Ralf, it works but there is a issue when you delete a user and transfer its records. As the user was >deleted it disappears from users table and if that user, for example, created addressbook records, he/she appears with the >id number used in the relational database, I may fix it changing the id number to a registered person but there most be a >way to left the name of the original creator. of course, an easier solution its to assign it to the user records was transfer >to. any comments?
I’ve got another DB error when using the addressbook search box, but I haven’t tested yet with mysql or in an clean >installation with postgres, I tested in an updated installation from 1.6.001.
thanks again, I hope you may give me hand with this.
Gustavo Cabrera
hi everybody
I’ve checked out those errors and are not generated by postgres consults, but for the update was made, this is the error when you try to search for a contact:
Database error
Invalid SQL: SELECT DISTINCT egw_addressbook.*,n_family,n_family<>’’ FROM egw_addressbook LEFT JOIN egw_addressbook_extra ON egw_addressbook.contact_id=egw_addressbook_extra.contact_id WHERE contact_tid=‘n’ AND account_id IS NULL AND (egw_addressbook.contact_owner=264 OR contact_private=0 AND egw_addressbook.contact_owner IN (-23,-11,-1,264,0) OR egw_addressbook.contact_owner IS NULL) AND (n_family ::text ILIKE ‘%gustavo%’ OR n_given ::text ILIKE ‘%gustavo%’ OR n_middle ::text ILIKE ‘%gustavo%’ OR n_prefix ::text ILIKE ‘%gustavo%’ OR n_suffix ::text ILIKE ‘%gustavo%’ OR n_fn ::text ILIKE ‘%gustavo%’ OR n_fileas ::text ILIKE ‘%gustavo%’ OR contact_bday ::text ILIKE ‘%gustavo%’ OR org_name ::text ILIKE ‘%gustavo%’ OR org_unit ::text ILIKE ‘%gustavo%’ OR contact_title ::text ILIKE ‘%gustavo%’ OR contact_role ::text ILIKE ‘%gustavo%’ OR contact_assistent ::text ILIKE ‘%gustavo%’ OR contact_room ::text ILIKE ‘%gustavo%’ OR adr_one_street ::text ILIKE ‘%gustavo%’ OR adr_one_street2 ::text ILIKE ‘%gustavo%’ OR adr_one_locality ::text ILIKE ‘%gustavo%’ OR adr_one_region ::text ILIKE ‘%gustavo%’ OR adr_one_postalcode ::text ILIKE ‘%gustavo%’ OR adr_one_countryname ::text ILIKE ‘%gustavo%’ OR contact_label ::text ILIKE ‘%gustavo%’ OR adr_two_street ::text ILIKE ‘%gustavo%’ OR adr_two_street2 ::text ILIKE ‘%gustavo%’ OR adr_two_locality ::text ILIKE ‘%gustavo%’ OR adr_two_region ::text ILIKE ‘%gustavo%’ OR adr_two_postalcode ::text ILIKE ‘%gustavo%’ OR adr_two_countryname ::text ILIKE ‘%gustavo%’ OR tel_work ::text ILIKE ‘%gustavo%’ OR tel_cell ::text ILIKE ‘%gustavo%’ OR tel_fax ::text ILIKE ‘%gustavo%’ OR tel_assistent ::text ILIKE ‘%gustavo%’ OR tel_car ::text ILIKE ‘%gustavo%’ OR tel_pager ::text ILIKE ‘%gustavo%’ OR tel_home ::text ILIKE ‘%gustavo%’ OR tel_fax_home ::text ILIKE ‘%gustavo%’ OR tel_cell_private ::text ILIKE ‘%gustavo%’ OR tel_other ::text ILIKE ‘%gustavo%’ OR tel_prefer ::text ILIKE ‘%gustavo%’ OR contact_email ::text ILIKE ‘%gustavo%’ OR contact_email_home ::text ILIKE ‘%gustavo%’ OR contact_url ::text ILIKE ‘%gustavo%’ OR contact_url_home ::text ILIKE ‘%gustavo%’ OR contact_freebusy_uri ::text ILIKE ‘%gustavo%’ OR contact_calendar_uri ::text ILIKE ‘%gustavo%’ OR contact_note ::text ILIKE ‘%gustavo%’ OR contact_geo ::text ILIKE ‘%gustavo%’ OR contact_pubkey ::text ILIKE ‘%gustavo%’ OR contact_value ::text ILIKE ‘%gustavo%’) ORDER BY egw_addressbook.n_family<>’’ DESC,egw_addressbook.n_family ASC,n_given ASC,org_name ASC:
ERROR: for SELECT DISTINCT, ORDER BY expressions must appear in select list
#0 /egroupware/phpgwapi/inc/class.egw_db.inc.php(674): egw_db->halt(‘Invalid SQL: SE…’, 1007, ‘/egroupware/…’)
#1 /egroupware/phpgwapi/inc/class.egw_db.inc.php(1971): egw_db->query(‘SELECT DISTINCT…’, 1007, ‘/egroupware/…’, 0, 30, false, 2)
#2 /egroupware/etemplate/inc/class.so_sql.inc.php(1008): egw_db->select(‘egw_addressbook’, ‘DISTINCT egw_ad…’, Array, 1007, ‘/egroupware/…’, 0, ‘ORDER BY egw_ad…’, ‘phpgwapi’, 30, ’ LEFT JOIN egw_…’)
#3 /egroupware/addressbook/inc/class.addressbook_sql.inc.php(455): so_sql->search(Array, ‘DISTINCT egw_ad…’, ‘egw_addressbook…’, Array, ‘%’, false, ‘OR’, Array, Array, ’ LEFT JOIN egw_…’, NULL)
#4 /egroupware/addressbook/inc/class.addressbook_so.inc.php(628): addressbook_sql->search(Array, false, ‘n_family<>’’ DE…’, ‘’, ‘%’, false, ‘OR’, Array, Array, ‘’, NULL)
#5 /egroupware/addressbook/inc/class.addressbook_ui.inc.php(978): addressbook_so->search(‘gustavo’, false, ‘n_family<>’’ DE…’, ‘’, ‘%’, false, ‘OR’, Array, Array)
#6 /egroupware/etemplate/inc/class.nextmatch_widget.inc.php(548): addressbook_ui->get_rows(Array, Array, Array)
#7 /egroupware/etemplate/inc/class.nextmatch_widget.inc.php(302): nextmatch_widget::call_get_rows(Array, Array, Array)
#8 /egroupware/etemplate/inc/class.boetemplate.inc.php(516): nextmatch_widget->pre_process(‘exec[nm]’, Array, Array, Array, Array, Object(etemplate))
#9 /egroupware/etemplate/inc/class.etemplate.inc.php(1084): boetemplate->extensionPreProcess(‘nextmatch’, ‘exec[nm]’, Array, Array, Array)
#10 /egroupware/etemplate/inc/class.etemplate.inc.php(862): etemplate->show_cell(Array, Array, Array, ‘exec’, 0, 2, ‘all’, ‘’, ‘/0/3A’)
#11 /egroupware/etemplate/inc/class.etemplate.inc.php(1429): etemplate->show_grid(Array, Array, Array, ‘exec’, 0, 0, ‘/0’)
#12 /egroupware/etemplate/inc/class.etemplate.inc.php(671): etemplate->show_cell(Array, Array, Array, ‘exec’, 0, 0, ‘’, NULL, ‘/0’)
#13 /egroupware/etemplate/inc/class.etemplate.inc.php(259): etemplate->show(Array, Array, Array, ‘exec’)
#14 /egroupware/etemplate/inc/class.etemplate.inc.php(531): etemplate->exec(‘addressbook.add…’, Array, Array, Array, Array, 0, ‘’, Array)
#15 [internal function]: etemplate->process_exec()
#16 /egroupware/phpgwapi/inc/common_functions.inc.php(886): call_user_func(Array)
#17 /egroupware/etemplate/process_exec.php(24): ExecMethod(‘etemplate.etemp…’)