6.0.0-beta1
▾
Tasks
New Task
Search
Photos
Wiki
▾
Tickets
New Ticket
Search
dev.horde.org
Toggle Alerts Log
Help
10/20/25
H
istory
A
ttachments
C
omment
W
atch
Download
Comment on [#10633] DB query with output name in HAVING clause
*
Your Email Address
*
Spam protection
Enter the letters below:
.__ . .___.__ . . [ __| [__ [__)\ / [_./|___[___| \/
Comment
> Note: this is actually Content 1.0.2 (but I could not select this for > the ticket. > > In function getSimilarObjects the HAVING clause uses the output name > of a selected column. But according to the PostgreSQL doku, HAVING > operates on the rows created by GROUP BY and thus can not use the > output name. > > As a result I get a fatal error with PostgreSQL: > > 2011-10-11T22:59:10+02:00 ERR: HORDE [ansel] SQL QUERY FAILED: > SQLSTATE[42703]: Undefined column: 7 ERROR: column "num_common_tags" > does not exist > LINE 1: ...ct_id <> 2285 GROUP BY objects.object_name HAVING num_common... > ^ > SELECT objects.object_name, COUNT(matches.object_id) AS > num_common_tags FROM "rampage_tagged" matches INNER JOIN > "rampage_tags" tags ON (tags.tag_id = matches.tag_id) INNER JOIN > "rampage_users" users ON users.user_id = matches.user_id AND > users.user_name = 'thpo' INNER JOIN "rampage_objects" objects ON > objects.object_id = matches.object_id INNER JOIN > "rampage_types" types > ON types.type_id=objects.type_id AND types.type_name = > 'image' WHERE > tags.tag_id IN (7) AND matches.object_id <> 2285 GROUP BY > objects.object_name HAVING num_common_tags >= 1 ORDER BY > num_common_tags DESC LIMIT 10 [pid 29125 on line 812 of > "/usr/share/php/Horde/Db/Adapter/Base.php"] > 2011-10-11T22:59:10+02:00 EMERG: HORDE [ansel] SQLSTATE[42703]: > Undefined column: 7 ERROR: column "num_common_tags" does not exist > LINE 1: ...ct_id <> 2285 GROUP BY objects.object_name HAVING num_common... > ^ [pid > 29125 on line 393 of "/srv/horde4/ansel/lib/Tagger.php"] >
Attachment
Watch this ticket
N
ew Ticket
M
y Tickets
S
earch
Q
uery Builder
R
eports
Saved Queries
Open Bugs
Bugs waiting for Feedback
Open Bugs in Releases
Open Enhancements
Enhancements waiting for Feedback
Bugs with Patches
Enhancements with Patches
Release Showstoppers
Stalled Tickets
New Tickets
Horde 5 Showstoppers