Re: How to concat strings so that trailing spaces remain

Поиск
Список
Период
Сортировка
От Andrus
Тема Re: How to concat strings so that trailing spaces remain
Дата
Msg-id e0isv9$24hf$1@news.hub.org
обсуждение исходный текст
Ответ на How to concat strings so that trailing spaces remain  ("Andrus" <eetasoft@online.ee>)
Список pgsql-general
> If you think that trailing spaces are significant data, you should
> probably be using VARCHAR not CHAR datatype.

I have existing database where there are only CHAR columns, no any VARCHAR
column.
I'm not sure will my appl work if I change all char columns to varchar
columns .
Is it reasonable to change all occurences of CHAR to VARCHAR in database ?


Are the following clauses exactly same for fields of type CHAR(10):

WHERE r1.c1::VARCHAR(10) || r1.c2::VARCHAR(10) || r1.c3::VARCHAR(10) >=
                r2.c1::VARCHAR(10) || r2.c2::VARCHAR(10) ||
r2.c3::VARCHAR(10)

and

WHERE r1.c1>=r2.c1  and r1.c2>=r2.c2 and r1.c3>=r2.c3

and

WHERE (r1.c1, r1.c2,r1.c3) >= (r2.c1, r2.c2,r2.c3)

Andrus.



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

Предыдущее
От: "Dave Page"
Дата:
Сообщение: Re: FAQ 1.1
Следующее
От: "Qingqing Zhou"
Дата:
Сообщение: Re: PANIC: heap_update_redo: no block