Re: strange (numeric) casting behaviour

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Sven Welte <Sven(dot)Welte(at)gmxpro(dot)net>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: strange (numeric) casting behaviour
Date: 2006-05-30 22:54:29
Message-ID: 4809.1149029669@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Sven Welte <Sven(dot)Welte(at)gmxpro(dot)net> writes:
> I'm experience some strange behaviour when casting numeric values.

This doesn't really have anything to do with casting as such. The
system thinks it can throw away the cast to NUMERIC(9,2) because the
function result is declared as already NUMERIC(9,2) ... but the function
is not actually constraining its result that way. In general a function
returning NUMERIC is considered to return unconstrained NUMERIC (and
likewise for VARCHAR etc).

Possibly we should disallow the length decoration on columns used in a
function result typedef, because it fools people into thinking that such
a decoration will be enforced.

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Euler Taveira de Oliveira 2006-05-31 01:47:49 Re: reindexdb command utlility
Previous Message Tom Lane 2006-05-30 22:41:01 Re: Too many function calls in view with LEFT JOIN