Skip site navigation (1) Skip section navigation (2)

Re: cast from integer to money

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Joseph Adams <joeyadams3(dot)14159(at)gmail(dot)com>, Stephen Frost <sfrost(at)snowman(dot)net>, Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: cast from integer to money
Date: 2011-04-04 03:33:56
Message-ID: 9152.1301888036@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackers
Robert Haas <robertmhaas(at)gmail(dot)com> writes:
> On Fri, Apr 1, 2011 at 10:33 PM, Joseph Adams
> <joeyadams3(dot)14159(at)gmail(dot)com> wrote:
>> The only other numeric types (other than oid, cardinal_number,
>> etc.) that can't be casted directly to money are float4 and float8,
>> and I suspect this is intentional.

> Agreed.

BTW, I think inclusion of int2 in this patch is just a waste of code
space.  The main argument for supporting these casts seems to be that
integer literals produced by the parser should be castable to money
without special pushups.  But the parser never produces native int2
constants.  So int4 and int8 will cover all the useful cases.

			regards, tom lane

In response to

pgsql-hackers by date

Next:From: Joseph AdamsDate: 2011-04-04 05:46:17
Subject: Re: cast from integer to money
Previous:From: Robert HaasDate: 2011-04-04 03:26:22
Subject: Re: Finding a flow when query is fired in postgresql

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group