2 ms·
What is the point of ever using CHAR(n) even when it is just a single character? See the example below for how it can be confusing if someone for some reason ev
by jeltz 3y ago
What is the point of ever using CHAR(n) even when it is just a single character? See the example below for how it can be confusing if someone for some reason ever decides to try to put a space into the field. Nah, simply just never use CHAR(n). Instead use varachar/nvarchar/text depending on your database or enum/uuid/... if it should not be a string. The CHAR(n) only exists for standard compliance and should in my opinion really be removed from the SQL standard.
# SELECT ' '::char(1) = '';
?column?
----------
t
(1 row)