BUG #11553: Sum function does not exist in Create View

From: Harry(at)HarryClarke(dot)me(dot)uk
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #11553: Sum function does not exist in Create View
Date: 2014-10-02 15:11:40
Message-ID: 20141002151140.2543.71200@wrigleys.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 11553
Logged by: Harry Clarke
Email address: Harry(at)HarryClarke(dot)me(dot)uk
PostgreSQL version: 9.3.5
Operating system: Windows 8.1 64bit
Description:

When attempting to create a view using the following commands
CREATE VIEW myschema.vc17_tetrad_months AS
SELECT mv.tetrad,
sum(mv.month) AS months_visited,
mv.the_geom
FROM ( SELECT
...
) mv
GROUP BY mv.tetrad, mv.the_geom;;

The error message
ERROR: function sum(text) does not exist
LINE 5: sum(mv.month) AS months_visited,
^
HINT: No function matches the given name and argument types. You might need
to add explicit type casts.

is returned. However, if the function "sum" is replaced by the function
"count". No error message is returned, and the expected result is obtained.

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message gary.weaver 2014-10-02 15:55:21 BUG #11554: Enforce that number and type of both columns involved in fkey are same type
Previous Message John R Pierce 2014-10-02 13:34:55 Re: BUG #11551: copy and paste issues in pgadmin SQL editor