Search Postgresql Archives

Re: How to concat strings so that trailing spaces remain

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> 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. 




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux