Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TuoX0-0000LF-OG for pgsql-bugs@arkaria.postgresql.org; Mon, 14 Jan 2013 18:13:10 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1TuoX0-00046c-98 for pgsql-bugs@arkaria.postgresql.org; Mon, 14 Jan 2013 18:13:10 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TuoRv-0003TU-1F for pgsql-bugs@postgresql.org; Mon, 14 Jan 2013 18:07:55 +0000 Received: from smtp-outbound-2.vmware.com ([208.91.2.13]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TuoRr-0000Id-1D for pgsql-bugs@postgresql.org; Mon, 14 Jan 2013 18:07:53 +0000 Received: from sc9-mailhost1.vmware.com (sc9-mailhost1.vmware.com [10.113.161.71]) by smtp-outbound-2.vmware.com (Postfix) with ESMTP id 3B81A28314; Mon, 14 Jan 2013 10:07:18 -0800 (PST) Received: from zcs-prod-ext-mta-2.vmware.com (zcs-prod-ext-mta-2.vmware.com [10.113.62.224]) by sc9-mailhost1.vmware.com (Postfix) with ESMTP id 34C4E18438; Mon, 14 Jan 2013 10:07:18 -0800 (PST) Received: from localhost (localhost.localdomain [127.0.0.1]) by zcs-prod-ext-mta-2.vmware.com (Postfix) with ESMTP id 21587C1544; Mon, 14 Jan 2013 10:07:18 -0800 (PST) X-Virus-Scanned: amavisd-new at zcs-prod-ext-mta-2.vmware.com Received: from zcs-prod-ext-mta-2.vmware.com ([127.0.0.1]) by localhost (zcs-prod-ext-mta-2.vmware.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Slel1pm8vM2Z; Mon, 14 Jan 2013 10:07:18 -0800 (PST) Received: from zcs-prod-ext-mta-2.vmware.com (localhost.localdomain [127.0.0.1]) by zcs-prod-ext-mta-2.vmware.com (Postfix) with ESMTP id EA961C1524; Mon, 14 Jan 2013 10:07:17 -0800 (PST) Received: from [192.168.1.90] (unknown [10.113.62.14]) by zcs-prod-ext-mta-2.vmware.com (Postfix) with ESMTPSA; Mon, 14 Jan 2013 10:07:17 -0800 (PST) Message-ID: <50F44961.2020305@vmware.com> Date: Mon, 14 Jan 2013 20:07:29 +0200 From: Heikki Linnakangas Organization: VMware User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.11) Gecko/20121122 Icedove/10.0.11 MIME-Version: 1.0 To: a_rares@yahoo.com CC: pgsql-bugs@postgresql.org Subject: Re: BUG #7807: "sign" function returns double References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -6.9 (------) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org On 14.01.2013 16:21, a_rares@yahoo.com wrote: > In the documentation > (http://www.postgresql.org/docs/9.1/static/functions-math.html) it is > written that the return type is the same as the input, but a query like > 'select sign(1::int)' returns a double It says that the input type is "dp or numeric", which means "double or numeric". So there are two overloaded functions called sign, sign(double), and sign(numeric). When the doc says that the return type is the same as input, it means that the return type is double, if you call sign(double), and numeric if you call sign(numeric). There is no sign(int) function, so the input "1::int" is cast to double, and the return type is also a double. - Heikki -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs