Char = varchar

Поиск
Список
Период
Сортировка
От Glen Parker
Тема Char = varchar
Дата
Msg-id 013c01c20c16$b3ccc330$0b01a8c0@johnpark.net
обсуждение исходный текст
Ответы Re: Char = varchar  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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 по дате отправления:

Предыдущее
От: Ron Snyder
Дата:
Сообщение: continual growth of pg_largeobjects and another table?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: ctid & updates