Re: Integrity constraint [false] problem

Поиск
Список
Период
Сортировка
От Stephan Szabo
Тема Re: Integrity constraint [false] problem
Дата
Msg-id 20021127084716.E93967-100000@megazone23.bigpanda.com
обсуждение исходный текст
Ответ на Integrity constraint [false] problem  (michaelbrewer@earthlink.net (Michael Brewer))
Список 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 по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Integrity constraint [false] problem
Следующее
От: Tom Lane
Дата:
Сообщение: Re: FreeBSD, Linux: select, select count(*) performance