Opened 16 years ago

Closed 16 years ago

#415 closed defect (fixed)

Can't select avg option in Experiment explorer when using Postgres

Reported by: Nicklas Nordborg Owned by: Nicklas Nordborg
Priority: major Milestone: BASE 2.1
Component: web Version:
Keywords: Cc:

Description

Got the followin error message:

ERROR: column "spt.position" must appear in the GROUP BY clause or be used in an aggregate function

Generated SQL:

SELECT "spt"."column" AS "column", 
COUNT("spt"."column") AS "cnt", 
AVG("spt"."ch1") AS "ch1", 
AVG("spt"."ch2") AS "ch2", 
AVG((CASE WHEN "spt"."ch2"=0 THEN null ELSE "spt"."ch1"/"spt"."ch2" END)) AS "e1" 
FROM "base2"."dynamic"."D40363Spot" "spt" 
INNER JOIN "base2"."dynamic"."D40363Pos" AS "pos" 
ON "pos"."cube" = "spt"."cube" AND "pos"."position" = "spt"."position"  
INNER JOIN "Reporters" AS rpt ON rpt.id = pos."reporter_id"  
WHERE "spt"."cube" = 2 AND "spt"."layer" = 1 AND ("rpt"."id" = 40241) 
GROUP BY "spt"."column" ORDER BY "spt"."position" ASC

It seems like Postgres is complaining about the ORDER BY "spt"."position" part, which is correct since the position is invalid when grouping by column.

Change History (1)

comment:1 Changed 16 years ago by Nicklas Nordborg

Resolution: fixed
Status: newclosed

(In [2813]) Fixes #415: Can't select avg option in Experiment explorer when using Postgres

Note: See TracTickets for help on using tickets.