Re: casts and conversions - Mailing list pgsql-sql

From Tom Lane
Subject Re: casts and conversions
Date
Msg-id 28136.992709847@sss.pgh.pa.us
Whole thread Raw
In response to casts and conversions  (Craig Longman <craigl@begeek.com>)
List pgsql-sql
Craig Longman <craigl@begeek.com> writes:
> select (unitcost*probability) from oppproducttype
> ERROR:  Unable to identify an operator '*' for types 'numeric' and
> 'float8'
>         You will have to retype this query using an explicit cast

> is this kind of thing a regular thing for postgresql?

The problem here is that we use a very generic, datatype-independent
algorithm for resolving operator type ambiguities.  It's nice and
extensible, which is great for user-defined datatypes ... but there's
really no way to handle all the standard numeric datatypes in an
intuitive fashion without introducing type-specific knowledge.  We've
had discussions about fixing this in the past (see e.g. pghackers
archives from last May & June), but we've not yet come up with a
solution that satisfies everyone.  It's still on the to-do list though.
        regards, tom lane


pgsql-sql by date:

Previous
From: Stephan Szabo
Date:
Subject: Re: calling user defined function with parameters..
Next
From: Tom Lane
Date:
Subject: Re: [HACKERS] Postgres