pgsql: Enforce pg_class.relchecks limit (32,767 or INT16_MAX)
pgsql: Enforce pg_class.relchecks limit (32,767 or INT16_MAX)
От:
Michael Paquier <michael@paquier.xyz>
Дата:
Enforce pg_class.relchecks limit (32,767 or INT16_MAX) pg_class.relchecks reports the number of CHECK constraints in a table, and is stored within a smallint. It was possible to define a table that could overflow the counter when specifying more than 32k constraints (new table or adding a constraint). This would cause the table to become undroppable, as this counter should never be negative when dropping these constraints. Author: Matthias van de Meent Reviewed-by: Bertrand Drouvot Reviewed-by: Jian He Reviewed-by: Sivaprasad Discussion: https://postgr.es/m/CAEze2WjSW4qaHYnvkTtbknp85eGEirGJTLMZatotdJJKiA+_hA@mail.gmail.com Backpatch-through: 14 Branch ------ REL_14_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/3eff6531d1d7870990bea7baa08a7d2b5868cda3 Modified Files -------------- doc/src/sgml/limits.sgml | 7 +++++++ src/backend/catalog/heap.c | 29 ++++++++++++++++++++++++----- 2 files changed, 31 insertions(+), 5 deletions(-)