Re: [HACKERS] Re: [BUGS] agregate function sum error - Mailing list pgsql-hackers

From Thomas G. Lockhart
Subject Re: [HACKERS] Re: [BUGS] agregate function sum error
Date
Msg-id 34F2CB37.C899E12C@alumni.caltech.edu
Whole thread Raw
In response to Re: [HACKERS] Re: [BUGS] agregate function sum error  (sferac@bo.nettuno.it)
List pgsql-hackers
> I thing that one of the bigest dificulty of PostgreSQL is how it treats numbers.
> SQL standard says that a number is comparable to, and compatible with, all
> other numbers (that is: all numbers are mutually comparable and mutually
> assignable). I think it means directly, without force it with the CAST or
> functions.

I agree that the numeric (and other) type coersions need some more work. One of the reasons
why we have been reluctant to embed _too_ many automatic coersions into the backend is that
it does not extend well into the type-extensible features of Postgres. But I hope to look at
this some for v6.4.

> and PostgreSQL show him/her this message ?
> WARN: type of my_small does not match target column my_int

this is an example of behavior which I think we _can_ change...

> - Well, if PostgreSQL know what I want why it doesn't do it for me ?
> I know that conversion is more expensive than warnning but it's more
> friendly. What do you think? ;-)

I agree up to a point. Once a user has chosen to use an "optimized data type" like "int2"
rather than "integer" or "int4" then they have also chosen to give up some capabilities of
the generic integer type such as dynamic range. However, some extra conversion stuff can and
should happen, and I have some ideas on how to do this. If any hacker wants to work on it,
let's start talking after the upcoming v6.3 release...

                                                      - Tom


pgsql-hackers by date:

Previous
From: jwieck@debis.com (Jan Wieck)
Date:
Subject: Re: [HACKERS] Re: [COMMITTERS] 'pgsql/src/bin/initdb initdb.sh'
Next
From: Frank Ridderbusch
Date:
Subject: Using the -u switch for diff in regress.sh