Table has type character varying, but query expects character varying

Started by Howard Coleover 18 years ago2 messagesgeneral
Jump to latest
#1Howard Cole
howardnews@selestial.com

I have the following table in a win32 8.2.2 database: (dumped from pgadmin)

CREATE TABLE email_directory
(
email_directory_id serial NOT NULL,
mailbox_id integer NOT NULL,
path character varying(255) NOT NULL,
marked_for_deletion boolean NOT NULL DEFAULT false,
CONSTRAINT email_directory_pkey PRIMARY KEY (email_directory_id),
CONSTRAINT email_directory_mailbox_id_fkey FOREIGN KEY (mailbox_id)
REFERENCES mailbox (mailbox_id) MATCH SIMPLE
ON UPDATE NO ACTION ON DELETE CASCADE
)
WITHOUT OIDS;

ALTER TABLE email_directory OWNER TO postgres;
GRANT ALL ON TABLE email_directory TO postgres;

CREATE UNIQUE INDEX email_directory_mailbox_id_path_idx
ON email_directory
USING btree
(mailbox_id, lower(path::text));

I have the following row in the table:

56, 4,'/Demo', f

When I try the following query I get the error below.

update email_directory set path='/Something else' where
email_directory_id=56

ERROR: attribute 3 has wrong type
SQL state: XX000
Detail: Table has type character varying, but query expects character
varying.

What has gone wrong?

Howard
www.selestial.com

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Howard Cole (#1)
Re: Table has type character varying, but query expects character varying

Howard Cole <howardnews@selestial.com> writes:

I have the following table in a win32 8.2.2 database: (dumped from pgadmin)
...
What has gone wrong?

You're using a broken release :-(
http://www.postgresql.org/docs/8.2/static/release-8-2-3.html

regards, tom lane