Implicitly casting integer to bigint (9.1)

From: Wells Oliver <wellsoliver(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Implicitly casting integer to bigint (9.1)
Date: 2013-08-01 01:29:34
Message-ID: CAOC+FBXoBpjebcK6eA3fCTf6Mbt0kHMsiDBYWR5n1++XvTjW5w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I have about 20 functions that all accept integer value inputs.

I want to have views which call these functions using various SUMs of
integers e.g.

select myfunction(sum(foo), sum(bar)) where foo and bar are integer types.

This doesn't really work, you get:

ERROR: function aggregates.stat_avg(bigint, bigint) does not exist

Integer is definitely the right type to use for the underlying table. Do I
really need to have an explicit cast to bigint in these views? Seems
tedious.

--
Wells Oliver
wellsoliver(at)gmail(dot)com

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David Johnston 2013-08-01 02:02:03 Re: Implicitly casting integer to bigint (9.1)
Previous Message Tom Lane 2013-07-31 19:55:44 Re: demystifying nested loop vs. merge join query plan choice