Re: Problem inserting data - Mailing list pgsql-sql

From Tom Lane
Subject Re: Problem inserting data
Date
Msg-id 17755.1213973846@sss.pgh.pa.us
Whole thread Raw
In response to Re: Problem inserting data  (Adrian Klaver <aklaver@comcast.net>)
List pgsql-sql
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


pgsql-sql by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: Problem inserting data
Next
From: Tk421
Date:
Subject: Re: Problem inserting data