Re: Integrity constraint [false] problem - Mailing list pgsql-general

From Stephan Szabo
Subject Re: Integrity constraint [false] problem
Date
Msg-id 20021127084716.E93967-100000@megazone23.bigpanda.com
Whole thread Raw
In response to Integrity constraint [false] problem  (michaelbrewer@earthlink.net (Michael Brewer))
List 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.



pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Integrity constraint [false] problem
Next
From: Tom Lane
Date:
Subject: Re: FreeBSD, Linux: select, select count(*) performance