Re: Problem inserting data

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Adrian Klaver <aklaver(at)comcast(dot)net>
Cc: pgsql-sql(at)postgresql(dot)org, Tk421 <vrobador(at)gmail(dot)com>
Subject: Re: Problem inserting data
Date: 2008-06-20 14:57:26
Message-ID: 17755.1213973846@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Adrian Klaver <aklaver(at)comcast(dot)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

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Tk421 2008-06-20 15:55:30 Re: Problem inserting data
Previous Message Adrian Klaver 2008-06-20 14:40:46 Re: Problem inserting data