Conversion of strings with just whitespace when storing in postgres

We are moving data from old systems to a new system and noted that one entry had a tax number of " ". Now, that is not a valid tax number, but we realized that the corresponding DB row has a value of null instead. Is this the default behaviour for strings that contain only whitespace? Is there an option to disable this behaviour and what are the caveats if we do?
4 Replies
DemoniacMilk | Lars
DemoniacMilk | LarsOP•3w ago
well that was easy sorry 😄
barnabasj
barnabasj•3w ago
you can configure this via the constraints, in your case trim?/allow_empty? The next person googing might be thankful that you asked 🙂
DemoniacMilk | Lars
DemoniacMilk | LarsOP•3w ago
thanks for the quick reply!

Did you find this page helpful?