Re: Integrity constraint [false] problem

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: Michael Brewer <michaelbrewer(at)earthlink(dot)net>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: Integrity constraint [false] problem
Date: 2002-11-27 16:48:24
Message-ID: 20021127084716.E93967-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


On 21 Nov 2002, Michael Brewer wrote:

> Hello, all; we've suddenly started seeing some really odd behavior in
> one of our PostgreSQL 7.2.3 [Solaris] databases. For some reason,
> even though the primary key to our student_information table is
> CHAR(9), any attempt to update any primary key fails:
>
> UPDATE student_information
> SET student_id='123456789'
> WHERE student_id='123456798'
>
> triggers an integrity constraint:
> ERROR: column "student_id" is of type 'integer' but expression is of
> type 'character'
> You will need to rewrite or cast the expression
>
> How can we fix these problems? Why would PostgreSQL think that
> student_id is of type integer when it's character(9)? Is there
> anything that might have caused this to start occuring that we can
> avoid?

Is it possible that one of the referencing tables has the wrong type
for some reason? The error could be coming from a foreign key check
perhaps.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2002-11-27 16:56:34 Re: FreeBSD, Linux: select, select count(*) performance
Previous Message Tom Lane 2002-11-27 16:40:00 Re: Integrity constraint [false] problem