I'm just starting out with Vertica and am glad that I found this site! I'll probably have a lot of questions and hope that I can get help from the community Thanks in advance.
My first question has to do with the CHAR vs VARCHAR data types. Is the following expected behavior? Notice that the CHAR data type ignores any spaces that are inserted:
Code: Select all
dbadmin=> insert into chartest values ('BETH', 'BETH');
OUTPUT
--------
1
(1 row)
dbadmin=> insert into chartest values ('BETH ', 'BETH ');
OUTPUT
--------
1
(1 row)
dbadmin=> select '*' || col_char || '*' col_char
dbadmin-> , length(col_char)
dbadmin-> , '*' || col_varchar || '*' col_varchar
dbadmin-> , length(col_varchar)
dbadmin-> from chartest;
col_char | length | col_varchar | length
----------+--------+-------------+--------
*BETH* | 4 | *BETH* | 4
*BETH* | 4 | *BETH * | 6
(2 rows)