On Wed, Oct 21, 2026 at 6:30 PM surya poondla <[email protected]> wrote:
> > I also ran every suggested form against the server, all are accepted. NOT > VALID is correctly left out of the ALTER CONSTRAINT list, since > the grammar rejects it there. src/bin/psql/t/010_tab_completion.pl passes. > Thank you so much for reviewing and testing. > > Two small, optional suggestions: > 1. After "ALTER CONSTRAINT fk DEFERRABLE" (or NOT DEFERRABLE) > nothing further is offered, although "DEFERRABLE INITIALLY DEFERRED" is > probably the most common way to write it. A rule > offering INITIALLY DEFERRED / INITIALLY IMMEDIATE there would > be nice, but I'm fine leaving it out to keep the patch small. > I agree with point 1 and added it, after DEFERRABLE (or NOT DEFERRABLE), tab now offers INITIALLY DEFERRED / INITIALLY IMMEDIATE, found by looking at ConstraintAttributeElem in gram.y. One adjustment while doing that: NOT DEFERRABLE only offers INITIALLY IMMEDIATE, not INITIALLY DEFERRED, I don't think NOT DEFERRABLE ... INITIALLY DEFERRED is valid (the grammar rejects it: "constraint declared INITIALLY DEFERRED must be DEFERRABLE"), but let me know if I'm missing something. > > 2. A couple of cases in 010_tab_completion.pl, e.g. for "alter table tab1 > alter constraint c not<tab>" and > "... check (a > 0) no<tab>", would keep the new rules from silently > regressing. > On point 2, honestly I'm not sure it's worth adding unless someone else feels strongly about it, happy to add if so. v3 of the ALTER CONSTRAINT patch attached, along with the CHECK constraint patch again (unchanged) for convenience. Thanks, Baji Shaik.
v2-0001-psql-Add-tab-completion-for-CHECK-constraint-modifie.patch
Description: Binary data
v3-0001-psql-Add-tab-completion-for-ALTER-TABLE-ALTER-CONSTR.patch
Description: Binary data
