Thread: DELETE FROM error

DELETE FROM error

From
"Daniel Bakken"
Date:
When running the following DELETE FROM in psql,

omni=# DELETE FROM inventory WHERE invid = '01044T';
ERROR:  Unable to identify an operator '=' for types 'varchar' and 'bpchar'
        You will have to retype this query using an explicit cast

I receive the above error message. The field "invid" is a bpchar.

TIA,

Daniel Bakken, IT Systems Administrator
dan@smtresource.com

SMT Resource | www.smtresource.com

254.771.3508   phone
254.771.3786   fax


Re: DELETE FROM error

From
Tom Lane
Date:
"Daniel Bakken" <dan@smtresource.com> writes:
> When running the following DELETE FROM in psql,
> omni=# DELETE FROM inventory WHERE invid = '01044T';
> ERROR:  Unable to identify an operator '=' for types 'varchar' and 'bpchar'
>         You will have to retype this query using an explicit cast

If this is not a recent version of Postgres, I'd wonder about incorrect
foreign key constraints involving this table --- ie, an attempt to
REFERENCE a varchar field from a bpchar field or vice versa.  7.2 will
complain about that when you try to define the FK constraint, but older
versions won't notice until the FK constraint actually tries to do some
comparisons.

            regards, tom lane