Re: View - Join based on dis-similar data types

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: View - Join based on dis-similar data types
Дата
Msg-id 29847.1047508359@sss.pgh.pa.us
обсуждение исходный текст
Ответ на View - Join based on dis-similar data types  ("speakeasy" <nospam_artd@speakeasy.net>)
Список pgsql-sql
"speakeasy" <nospam_artd@speakeasy.net> writes:
> I have a field defined as a character(50) data type, and the same field
> stored in a transition table as a text type.

> The view itself work based on the join, however sub-queries against the view
> on that field do not return any data.

You probably need to rtrim() the CHAR field so that the trailing blanks
in it don't foul up the comparison to the TEXT field.  Trailing blanks
are considered insignificant in CHAR comparisons ... but not in TEXT
comparisons.  So,
WHERE rtrim(charfield) = textfield

should work.
        regards, tom lane


В списке pgsql-sql по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: extending ORDER BY make query much slower
Следующее
От: Steve Crawford
Дата:
Сообщение: Re: "hide" values in a column