Re: explicit cast error

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: explicit cast error
Дата
Msg-id 11365.1025883338@sss.pgh.pa.us
обсуждение исходный текст
Ответ на explicit cast error  (Lynn David Newton <lynn.newton@cox.net>)
Список pgsql-general
Lynn David Newton <lynn.newton@cox.net> writes:
> Never mind the table def for right now.

That's not a good idea, because I'll bet that inconsistency between abc
and def is exactly your problem.

> insert into abc
>   (c2, lab, dlab, bdigits) values
>   (5, 'somestring', 'abc123', 3410999762);

> psql returns to me this message:

> psql: ... ERROR: Unable to identify an operator '=' for types 'int4' and 'text'
>       You will have to retype this query using an explicit cast

I am guessing that (a) you are trying to make a foreign key reference
from an integer column to a text column, and (b) you are not using a
recent Postgres release.  Recent releases would have complained when
you tried to define the foreign-key reference, not on first use.

            regards, tom lane



В списке pgsql-general по дате отправления:

Предыдущее
От: Darren Ferguson
Дата:
Сообщение: Re: two primairy key in one table ?
Следующее
От: Laurette Cisneros
Дата:
Сообщение: Re: epoch from date field