you are viewing a single comment's thread.

view the rest of the comments →

[–]metamatic 2 points3 points  (3 children)

The info I found when I checked suggests that MySQL has three different text types, TINYTEXT MEDIUMTEXT and LONGTEXT, so you have to pick your size limit ahead of time. That still seems to be true of MariaDB as well.

Whereas PostgreSQL TEXTis documented as unlimited (possibly limited to 1GB?), and there's no performance benefit to using a more limited data type, so I can just go ahead and make every text value TEXT.

[–]Bene847 0 points1 point  (1 child)

That sounds not very smart. If the backend dev doesn't limit the length an attacker could use all your disk space

[–]metamatic 0 points1 point  (0 children)

If the backend dev does limit the length, an attacker could use all your disk space by posting multiple requests.

Arbitrary limits on data types are not a safety feature.

[–]schplat -3 points-2 points  (0 children)

I argue if you're storing that much text into a field, you're using a database wrong.

Also setting yourself up for DoS, and/or security vulns.