The recent updates to for Postgres users have an issue with Postgres 8.x. The SQL in the pgcalc method (line 51) leads to the following error:

sqlalchemy.exc.ProgrammingError: (ProgrammingError) column "d.total_size" must 
appear in the GROUP BY clause or be used in an aggregate function
LINE 4: FROM (  SELECT d.total_siz...

The problem is that version of Postgres before 9.x were a bit more restrictive in the use of GROUP BY. This can be fixed using DISTINCT ON instead. See this StackOverflow post for more info:

I've included a patch below. Let me know if a pull request would be preferred.

--- a/scripts/
+++ b/scripts/
@@ -52,7 +52,7 @@
     sql = """
            UPDATE galaxy_user
               SET disk_usage = (SELECT COALESCE(SUM(total_size), 0)
-                                  FROM (  SELECT d.total_size
+ FROM ( SELECT DISTINCT ON ( d.total_size, FROM history_dataset_association hda JOIN history h ON = hda.history_id JOIN dataset d ON hda.dataset_id =
@@ -62,7 +62,7 @@
                                                  AND d.purged = false
AND NOT IN (SELECT dataset_id FROM library_dataset_dataset_association)
-                                        GROUP BY sizes)
+                                        ) sizes)
             WHERE id = :id
         RETURNING disk_usage;
Lance Parsons - Scientific Programmer
134 Carl C. Icahn Laboratory
Lewis-Sigler Institute for Integrative Genomics
Princeton University

Please keep all replies on the list by using "reply all"
in your mail client.  To manage your subscriptions to this
and other Galaxy lists, please use the interface at:

Reply via email to