> On Oct 6, 2026, at 05:24, Baji Shaik <[email protected]> wrote:
> 
> Hello,
> 
> Two small ones. 
> 1/ after ALTER TABLE t ALTER CONSTRAINT c, psql offers
> nothing so add DEFERRABLE/ENFORCED/INHERIT and their NOT/NO forms. 
> 
> 2/ after ADD [CONSTRAINT c] CHECK (...), psql offers nothing so add NOT
> ENFORCED, NOT VALID, NO INHERIT. 
> 
> Thanks,
> Baji Shaik.
> 
> <0001-psql-Add-tab-completion-for-ALTER-TABLE-ALTER-CONSTR.patch><0001-psql-Add-tab-completion-for-CHECK-constraint-modifie.patch>

Thanks for the patch.

I think both 0001 and 0002 share a common problem:
```
evantest=# alter table t alter constraint c not

```

After NOT or NO, tab completion doesn’t suggest any further keywords. Here is 
an example from the same file for reference:
```
        /* ALTER STATISTICS <name> */
        else if (Matches("ALTER", "STATISTICS", MatchAny))
                COMPLETE_WITH("OWNER TO", "RENAME TO", "SET SCHEMA", "SET 
STATISTICS");
        /* ALTER STATISTICS <name> SET */
        else if (Matches("ALTER", "STATISTICS", MatchAny, "SET"))
                COMPLETE_WITH("SCHEMA", "STATISTICS");
```

As you can see, besides suggesting SET SCHEMA and SET STATISTICS, there is a 
separate rule that matches SET and suggests SCHEMA and STATISTICS. I think we 
need similar rules for NOT and NO here. And 0001 has the same thing for 
INITIALLY.

Best regards,
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/






Reply via email to