ted
(Ted Johansson)
Octobre 18, 2024, 4:35
11
J’ai une PR ici qui devrait également fonctionner pour PG13.
main ← fix/problem-check-target-pg13
opened 03:40AM - 18 Oct 24 UTC
### What is this change?
In #29169 we added a `NULLS NOT DISTINCT` option to … the unique index on `problem_check_trackers`. This is to enforce uniqueness even when the `target` is `NULL`. (Postgres considers all `NULL`s to be distinct by default.)
However, this only works in PG15. In PG13 it does nothing.
This commit adds a default dummy string value `__NULL__` to `target`. Since it's a string, PG13 will be able to correctly identify duplicate records.
### Is it safe to run this?
Adding a default value will lock the table and can cause issues on large tables, but the `problem_check_trackers` table is constrained by the number of problem check classes, and is in the ballpark of 10-100 rows.
Nous réfléchissons encore à la faisabilité de ce cas dans la nature et à l’investissement que nous devrions potentiellement consacrer pour le contourner.
1 « J'aime »