Re: How to concat strings so that trailing spaces remain - Mailing list pgsql-general

From Andrus
Subject Re: How to concat strings so that trailing spaces remain
Date
Msg-id e0isv9$24hf$1@news.hub.org
Whole thread Raw
In response to How to concat strings so that trailing spaces remain  ("Andrus" <eetasoft@online.ee>)
List 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 by date:

Previous
From: "Dave Page"
Date:
Subject: Re: FAQ 1.1
Next
From: "Qingqing Zhou"
Date:
Subject: Re: PANIC: heap_update_redo: no block