pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kyle <kyle@actarg.com>
To: pgsql-sql@postgresql.org
Subject: Possible 7.1RC1 bug
Date: Thu, 29 Mar 2001 13:02:14 -0700
Message-ID: <3AC394C6.E7D2E184@actarg.com> (raw)

Here's a fragment of code that works on 7.0.3 but gives a type mismatch
on 7.1:

Under 7.1RC1, func1 fails and func2 builds OK.  The error is:

ERROR:  return type mismatch in function: declared to return int4,
returns numeric

It appears that sum(int4) returns type numeric.  Shouldn't it return
int4?


create table ints (
    inte        int4
);

create function func1() returns int4 as '
    select coalesce(sum(inte),0) from ints;
' language 'sql';

create function func2() returns int4 as '
    select coalesce(sum(inte)::int4,0) from ints;
' language 'sql';

Attachments:

kyle.vcf (text/x-vcard, 184B) download begin:vcard n:Bateman;Kyle x-mozilla-html:FALSE org:Action Target Inc. adr:;;;;;; version:2.1 email;internet:kyle@actarg.com title:President x-mozilla-cpt:;0 fn:Kyle Bateman end:vcard

view thread (4+ messages)  latest in thread

Message-ID: <3AC394C6.E7D2E184@actarg.com>
Permalink:  ../3AC394C6.E7D2E184@actarg.com/
Also on:    postgresql.org/message-id/3AC394C6.E7D2E184@actarg.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-sql@postgresql.org
  Cc: kyle@actarg.com
  Subject: Re: Possible 7.1RC1 bug
  In-Reply-To: <3AC394C6.E7D2E184@actarg.com>
  References: <3AC394C6.E7D2E184@actarg.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