DELETE FROM error message

Started by Daniel Bakkenover 23 years ago5 messagesgeneral
Jump to latest
#1Daniel Bakken
dan@smtresource.com

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

#2Darren Ferguson
darren@crystalballinc.com
In reply to: Daniel Bakken (#1)
Re: DELETE FROM error message

You will need to cats '01044T' to bpchar since postgres will take any
string as a varchar unless specified otherwise.

Use the following

DELETE FROM inventory WHERE invid = '01044T'::VARCHAR;

HTH

Darren

On Wed, 17 Jul 2002, Daniel Bakken wrote:

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

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo@postgresql.org)

--
Darren Ferguson

#3Robert Treat
xzilla@users.sourceforge.net
In reply to: Darren Ferguson (#2)
Re: DELETE FROM error message

DELETE FROM inventory WHERE invid = '01044T'::BPCHAR;

Robert Treat

Show quoted text

On Wed, 2002-07-17 at 21:59, Darren Ferguson wrote:

You will need to cats '01044T' to bpchar since postgres will take any
string as a varchar unless specified otherwise.

Use the following

DELETE FROM inventory WHERE invid = '01044T'::VARCHAR;

HTH

Darren

On Wed, 17 Jul 2002, Daniel Bakken wrote:

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

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo@postgresql.org)

--
Darren Ferguson

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly

#4Daniel Bakken
dan@smtresource.com
In reply to: Robert Treat (#3)
Re: DELETE FROM error message

I tried your suggestion (both ways), but I still get the same error message
about explicit casts.

Daniel Bakken

Show quoted text

DELETE FROM inventory WHERE invid = '01044T'::BPCHAR;

Robert Treat

On Wed, 2002-07-17 at 21:59, Darren Ferguson wrote:

You will need to cats '01044T' to bpchar since postgres will take any
string as a varchar unless specified otherwise.

Use the following

DELETE FROM inventory WHERE invid = '01044T'::VARCHAR;

HTH

Darren

#5Daniel Bakken
dan@smtresource.com
In reply to: Daniel Bakken (#4)
Re: DELETE FROM error message

FYI, I don't get that error message when I SELECT. For instance:

SELECT * FROM inventory WHERE invid = '01044T';

works just fine with no errors. When I try to delete that same record, I get
the error about explicit casts.

Daniel Bakken

Show quoted text

I tried your suggestion (both ways), but I still get the same
error message
about explicit casts.

Daniel Bakken

DELETE FROM inventory WHERE invid = '01044T'::BPCHAR;

Robert Treat

On Wed, 2002-07-17 at 21:59, Darren Ferguson wrote:

You will need to cats '01044T' to bpchar since postgres will take any
string as a varchar unless specified otherwise.

Use the following

DELETE FROM inventory WHERE invid = '01044T'::VARCHAR;