You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Column check introspection corrupts expressions with NOT VALID / NO INHERIT #1143
Column check is extracted by stripping a fixed prefix/suffix from pg_get_constraintdef(...), assuming the def is exactly CHECK (...).
When the constraint has a suffix (NOT VALID, NO INHERIT), the length heuristic returns a corrupted expression:
constraintdef
returned check
CHECK (id > 0) NOT VALID
id > 0) NOT VALI
CHECK (id > 0) NO INHERIT
id > 0) NO INHERI
Studio then shows / may round-trip an invalid check expression.
Repro
createtablepublic.t (id int8);
altertablepublic.t add constraint t_id_check check (id >0) not valid;
Then columns.retrieve / list — check is not id > 0.
Expected
check should be the expression only (id > 0), using pg_get_expr(conbin, conrelid) (with one outer paren pair stripped to preserve the existing API shape).
Activity