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
list_tables returns truncated check expressions for NOT VALID and NO INHERIT constraints #516
list_tables with verbose: true returns a cut-off check expression when the column's CHECK constraint was created with NOT VALID or NO INHERIT. The returned text is not valid SQL, for example a > 0) NOT VALI instead of a > 0. Constraints without either option are returned correctly.
To Reproduce
Run the following SQL:
createtablet (a int, b int, c int);
altertable t add constraint a_pos check (a >0) not valid;
altertable t add constraint b_pos check (b >0) no inherit;
altertable t add constraint c_pos check (c >0);
Call list_tables with { "schemas": ["public"], "verbose": true }.
The check field of each column in t is:
column
check
a
a > 0) NOT VALI
b
b > 0) NO INHERI
c
c > 0
Expected behavior
check contains only the constraint expression, the same way it does for c:
Activity
fix(pg-meta): return complete check expressions for NOT VALID and NO …