On Mon, Apr 15, 2013 at 7:51 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
Rodrigo Barboza <rodrigombufrj@gmail.com> writes: > I created a implic cast for mytype to bigint. > So when I do the same query it does seq scan, because the column is > transformed into bigint.
Yeah. One reason why there's not an unsigned int type already is that it seems impossible to shoehorn it into the numeric promotion hierarchy without breaking a lot of existing cases. You definitely aren't likely to get nice results by just adding some implicit casts without doing a very careful design beforehand.
regards, tom lane
I just added implicit cast from my type to int8, numeric and float.