Re: explicit cast error

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Lynn David Newton <lynn(dot)newton(at)cox(dot)net>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: explicit cast error
Date: 2002-07-05 15:35:38
Message-ID: 11365.1025883338@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Lynn David Newton <lynn(dot)newton(at)cox(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Nigel J. Andrews 2002-07-05 16:05:37 Re: Time bug fixed?
Previous Message Darren Ferguson 2002-07-05 15:28:09 Re: two primairy key in one table ?