6.0.0-beta1
7/4/25

[#8610] Searching for similar Faces error "MDB2 Error: no such field" using postgresql
Summary Searching for similar Faces error "MDB2 Error: no such field" using postgresql
Queue Ansel
Queue Version FRAMEWORK_3
Type Bug
State Resolved
Priority 2. Medium
Owners mrubinsk (at) horde (dot) org
Requester tx4587 (at) crawford (dot) homeunix (dot) net
Created 09/28/2009 (5758 days ago)
Due
Updated 09/29/2009 (5757 days ago)
Assigned 09/29/2009 (5757 days ago)
Resolved 09/29/2009 (5757 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
09/29/2009 03:00:26 PM Michael Rubinsky Comment #3
State ⇒ Resolved
Reply to this comment
Seems like mySQL allows a column alias in the HAVING clause, while 
postgres and some others do not.



Fixed for 1.1, thanks for the report.
09/29/2009 02:58:13 PM CVS Commit Comment #2 Reply to this comment
Changes have been made in CVS for this ticket:

Not all RDBMS allow column aliases in HAVING clause.
Bug: 8610
http://cvs.horde.org/diff.php/ansel/lib/Faces.php?rt=horde&r1=1.18.2.6&r2=1.18.2.7&ty=u
09/29/2009 02:27:17 AM Chuck Hagenbuch Assigned to Michael Rubinsky
State ⇒ Assigned
 
09/28/2009 11:24:40 PM tx4587 (at) crawford (dot) homeunix (dot) net Comment #1
Priority ⇒ 2. Medium
Type ⇒ Bug
Summary ⇒ Searching for similar Faces error "MDB2 Error: no such field" using postgresql
Queue ⇒ Ansel
Milestone ⇒
Patch ⇒ No
State ⇒ Unconfirmed
Reply to this comment
Looks like the following log entry may give details. I'm using 
Postgresql 8.4.1 and have not tried this on MySQL:



Sep 28 16:15:43 HORDE [error] [ansel] MDB2 Error: no such field: 
_doQuery: [Error message: Could not execute statement]

[Last executed query: SELECT COUNT(*) as face_matches, i.face_id, 
f.face_name, f.image_id, f.gallery_id, f.face_signature FROM 
ansel_faces_index i, ansel_faces f WHERE f.face_id = i.face_id AND 
i.face_id <> 12 GROUP BY i.face_id HAVING face_matches > 0 ORDER BY 
face_matches DESC LIMIT 20 OFFSET 0]

[Native message: ERROR:  column "face_matches" does not exist at 
character 215]

  [pid 10376 on line 1053 of 
"/var/www/html/horde-webmail-1.2.4/ansel/lib/Faces.php"]

Sep 28 16:15:43 HORDE [debug] [ansel] MDB2 Error: no such field: 
_doQuery: [Error message: Could not execute statement]

[Last executed query: SELECT COUNT(*) as face_matches, i.face_id, 
f.face_name, f.image_id, f.gallery_id, f.face_signature FROM 
ansel_faces_index i, ansel_faces f WHERE f.face_id = i.face_id AND 
i.face_id <> 12 GROUP BY i.face_id HAVING face_matches > 0 ORDER BY 
face_matches DESC LIMIT 20 OFFSET 0]

[Native message: ERROR:  column "face_matches" does not exist at 
character 215]

  [pid 10376 on line 176 of 
"/var/www/html/horde-webmail-1.2.4/lib/Horde/Notification.php"]

Sep 28 16:15:43 HORDE [debug] [ansel] SQL query by 
Horde_Alarm_sql::_list(): SELECT alarm_id, alarm_uid, alarm_start, 
alarm_end, alarm_methods, alarm_params, alarm_title, alarm_text, 
alarm_snooze, alarm_internal FROM horde_alarms WHERE alarm_dismissed = 
0 AND ((alarm_snooze IS NULL AND alarm_start <= ?) OR alarm_snooze <= 
?) AND (alarm_end IS NULL OR alarm_end >= ?) AND (alarm_uid = ? OR 
alarm_uid = ?) ORDER BY alarm_start, alarm_end [pid 10376 on line 148 
of "/var/www/html/horde-webmail-1.2.4/lib/Horde/Alarm/sql.php"]



The error messages is displayed across the top of the page, and in the 
log entry above.

Saved Queries