Adrian Klaver <aklaver@comcast.net> writes:
> Two options:
> 1) Change the column in Postgres to an integer type.
> 2) Change the assignment in pg_cast from explicit to implied for the
> int4,bool cast. See for more details:
> http://www.postgresql.org/docs/8.3/interactive/catalog-pg-cast.html
Making it an assignment cast would be sufficient for the particular
case shown, and would be less likely to introduce surprising behavior
elsewhere.
Of course, depending on how thoroughly the application confuses int
and bool, you might be stuck with using the implicit cast. But it's
a bit scary. I think I'd look at option (1) before trying (2) with an
implicit cast.
regards, tom lane