Re: casts and conversions

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Craig Longman <craigl(at)begeek(dot)com>
Cc: PostgreSQL SQL List <pgsql-sql(at)postgresql(dot)org>
Subject: Re: casts and conversions
Date: 2001-06-16 16:44:07
Message-ID: 28136.992709847@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Craig Longman <craigl(at)begeek(dot)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

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2001-06-16 16:54:53 Re: [HACKERS] Postgres
Previous Message Stephan Szabo 2001-06-16 16:27:41 Re: calling user defined function with parameters..