Re: explicit cast error - Mailing list pgsql-general

From Tom Lane
Subject Re: explicit cast error
Date
Msg-id 11365.1025883338@sss.pgh.pa.us
Whole thread Raw
In response to explicit cast error  (Lynn David Newton <lynn.newton@cox.net>)
List 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 by date:

Previous
From: Darren Ferguson
Date:
Subject: Re: two primairy key in one table ?
Next
From: Laurette Cisneros
Date:
Subject: Re: epoch from date field