sql: Remove PostgreSQL text limits, fixes hangs
authorJay Colson <jay@karma.net>
Sun, 19 Jul 2020 20:18:01 +0000 (16:18 -0400)
committerManuel Nickschas <sputnick@quassel-irc.org>
Sat, 28 Nov 2020 12:42:31 +0000 (13:42 +0100)
commit9fa6f42009ada45e4787972b5e137ba19876c8dd
tree1aadbc9f64d4e7c42d562ed14d014324d7a60226
parentf09a86ab1cc01a80aa6fd52a875920e18d1d3a5b
sql: Remove PostgreSQL text limits, fixes hangs

Modify all PostgreSQL text column limits to the unlimited TEXT type
instead of VARCHAR.  Modern PostgreSQL versions (year 2000 onward) do
not store text any differently depending on whether or not it's TEXT
or VARCHAR.
https://www.postgresql.org/message-id/20667.971213689%40sss.pgh.pa.us

This avoids having the core fail to save values or hang entirely, and
also addresses migration issues from SQLite where text limits aren't
applied.

See https://bugs.quassel-irc.org/issues/1526

This shouldn't introduce any noticeable performance impact:
https://stackoverflow.com/questions/1067061/does-a-varchar-fields-declared-size-have-any-impact-in-postgresql

Fix up a spurious length-limited field for SQLite in case length
limits are applied in newer SQLite versions.

The proper long-term fix is to implement length checks throughout the
Quassel core (sanitizing data) and client (to warn of length issues),
rather than relying on the database to enforce limits.

Sponsored by Postgres Phone Plans.  UNLIMITED TEXT, TALK, and DATA for
$9.99 a month!  Some restrictions apply.  This is not serious.

[Commit squashed from "jcolson", thanks!]
See https://github.com/quassel/quassel/pull/478

Fixes GH-478
Fixes #1526
15 files changed:
src/core/SQL/PostgreSQL/setup_000_quasseluser.sql
src/core/SQL/PostgreSQL/setup_010_sender.sql
src/core/SQL/PostgreSQL/setup_020_identity.sql
src/core/SQL/PostgreSQL/setup_030_identity_nick.sql
src/core/SQL/PostgreSQL/setup_040_network.sql
src/core/SQL/PostgreSQL/setup_050_buffer.sql
src/core/SQL/PostgreSQL/setup_080_ircservers.sql
src/core/SQL/PostgreSQL/version/30/upgrade_000_alter_quasseluser.sql [new file with mode: 0644]
src/core/SQL/PostgreSQL/version/30/upgrade_010_alter_sender.sql [new file with mode: 0644]
src/core/SQL/PostgreSQL/version/30/upgrade_020_alter_identity.sql [new file with mode: 0644]
src/core/SQL/PostgreSQL/version/30/upgrade_030_alter_identity_nick.sql [new file with mode: 0644]
src/core/SQL/PostgreSQL/version/30/upgrade_040_alter_network.sql [new file with mode: 0644]
src/core/SQL/PostgreSQL/version/30/upgrade_050_alter_buffer.sql [new file with mode: 0644]
src/core/SQL/PostgreSQL/version/30/upgrade_080_alter_ircservers.sql [new file with mode: 0644]
src/core/SQL/SQLite/setup_000_quasseluser.sql