Rodrigo Barboza <rodrigombufrj(at)gmail(dot)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