Re: Functions just dont want to work! [hard] - Mailing list pgsql-general

From Joel Burton
Subject Re: Functions just dont want to work! [hard]
Date
Msg-id 20021204203344.GB19111@temp.joelburton.com
Whole thread Raw
In response to Re: Functions just dont want to work! [hard]  ("Andrew J. Kopciuch" <akopciuch@bddf.ca>)
Responses Re: Functions just dont want to work! [hard]  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
On Wed, Dec 04, 2002 at 01:25:43PM -0700, Andrew J. Kopciuch wrote:
> > Problem is that 24 is not an int2 -- it's an int4 (generic int type).
> > For example:
> >
>
> Yes it is ...  int2 is a two byte integer, meaning it has a range from
> -32768 to +32767.  Unless I totally mistaken, 24 falls within that range.
>
> Am I missing something vital to this problem?  What you have said seems
> incorrect to me.

Well, of course, you're right in a strict sense.
But the constant 24 in PG is parsed as an int4 not an int2, and PG isn't
coercing it automatically to an int2 for the function.

> What version are you using?

His original setup worked in 7.2 (and still does for my test case); the
behavior has changed in 7.3 (as shown in my email).

--

Joel BURTON  |  joel@joelburton.com  |  joelburton.com  |  aim: wjoelburton
Independent Knowledge Management Consultant

pgsql-general by date:

Previous
From: "Andrew J. Kopciuch"
Date:
Subject: Re: Functions just dont want to work! [hard]
Next
From: "scott.marlowe"
Date:
Subject: Re: performance tuning