Char = varchar - Mailing list pgsql-general

From Glen Parker
Subject Char = varchar
Date
Msg-id 013c01c20c16$b3ccc330$0b01a8c0@johnpark.net
Whole thread Raw
Responses Re: Char = varchar
List pgsql-general
Hi all,

Didn't see a reference to this in the archives, so here goes.
In pg 7.2.1, comparing char to varchar appears broken.  Can't believe
there isnt more chatter about this on the list.  Anyhow, try the
following:

  Create table test (field1 char(10), field2 varchar(10));
  Select count(*) from test where field1 = field2;

You get:

  ERROR:  Unable to identify an operator '=' for types 'character' and
'character varying'
    You will have to retype this query using an explicit cast

Not sure what I'm asking for here...  I know casting will fix it, I know
changing my schema will work.  Would creating an operator be a
reasonable workaround perhaps?

Tia
Glen Parker
glenebob@nwlink.com


pgsql-general by date:

Previous
From: Ron Snyder
Date:
Subject: continual growth of pg_largeobjects and another table?
Next
From: Tom Lane
Date:
Subject: Re: ctid & updates