pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: John R Pierce <pierce@hogranch.com>
To: Harry@HarryClarke.me.uk
To: pgsql-bugs@postgresql.org
Subject: Re: BUG #11553: Sum function does not exist in Create View
Date: Thu, 02 Oct 2014 15:54:10 -0700
Message-ID: <542DD792.8050201@hogranch.com> (raw)
In-Reply-To: <20141002151140.2543.71200@wrigleys.postgresql.org>
References: <20141002151140.2543.71200@wrigleys.postgresql.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

On 10/2/2014 8:11 AM, Harry@HarryClarke.me.uk wrote:
> The following bug has been logged on the website:
>
> Bug reference:      11553
> Logged by:          Harry Clarke
> Email address:      Harry@HarryClarke.me.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.
>
>

what datatype is mv.month ?

if its TEXT as the error says, well, you can't add strings, can you?   
maybe your inner query (which you didn't show) should have returned an 
INTEGER instead of text...



-- 
john r pierce                                      37N 122W
somewhere on the middle of the left coast



-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (2+ messages)

Message-ID: <542DD792.8050201@hogranch.com>
Permalink:  ../542DD792.8050201@hogranch.com/
Also on:    postgresql.org/message-id/542DD792.8050201@hogranch.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: pierce@hogranch.com, Harry@HarryClarke.me.uk
  Subject: Re: BUG #11553: Sum function does not exist in Create View
  In-Reply-To: <542DD792.8050201@hogranch.com>
  References: <20141002151140.2543.71200@wrigleys.postgresql.org> <542DD792.8050201@hogranch.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox