[prev in list] [next in list] [prev in thread] [next in thread] 

List:       postgresql-general
Subject:    [GENERAL] Char = varchar
From:       "Glen Parker" <glenebob () nwlink ! com>
Date:       2002-06-04 22:25:16
[Download RAW message or body]

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


---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic