Re:Postgres: Boundless `Text` and Back Again
by skybrian on Friday September 10, 2021 @07:49PM
(#28488136)
At a minimum, you can think about whether the text should fit on a single line (edited with a text box) or can it be multiple lines (a text area).
That doesn’t help you decide how long a single line can be, though. Also, does the single-line text field prohibit newlines and how do you do that properly?
If you have a legal name, you might want to write that person a letter (an invoice, injunction, notification of breach, whatever), so it must fit into the address field. If you allow a 2000 character name, it likely won't fit. Same for street names and the likes.
Not fitting a full name into a field sucks, but at least it gives the one filling it the choice how to shorten it.
If the data goes into some kind of webpage, does it even render properly if it's very large? If it goes into a hover text, or in a box that's too small for a proper scroll bar, it becomes unreadable it too big.
If text becomes really big (and it might be gigabytes if there's no limit), storage cost becomes an issue.
From this perspective, you basically never want unlimited TEXT fields anywhere, at least not exposed to customers. Maybe it's OK for internal some internal, at least if you can yell at your users if they abuse it too much.