Re: add tab-complete for ALTER DOMAIN ADD... - Mailing list pgsql-hackers

From Álvaro Herrera
Subject Re: add tab-complete for ALTER DOMAIN ADD...
Date
Msg-id 202505111422.6ynxzsibjtfk@alvherre.pgsql
Whole thread Raw
In response to Re: add tab-complete for ALTER DOMAIN ADD...  (Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>)
Responses Re: add tab-complete for ALTER DOMAIN ADD...
List pgsql-hackers
On 2025-Apr-29, Dagfinn Ilmari Mannsåker wrote:

> jian he <jian.universality@gmail.com> writes:

> > +    /* ALTER DOMAIN <sth> ADD */
> > +    else if (Matches("ALTER", "DOMAIN", MatchAny, "ADD"))
> > +        COMPLETE_WITH("CONSTRAINT", "NOT NULL", "CHECK");
> 
> I think the completion for CHECK should include the opening paren too,
> since that's required for the expression.

Yeah, we do that elsewhere.

> We could also add completion after CONSTRAINT <name>, like this:
> 
>     else if(Matches("ALTER", "DOMAIN", MatchAny, "ADD", "CONSTRAINT", MatchAny))
>         COMPLETE_WITH("NOT NULL", "CHECK (");

Done that, and pushed.

-- 
Álvaro Herrera               48°01'N 7°57'E  —  https://www.EnterpriseDB.com/
"Los dioses no protegen a los insensatos.  Éstos reciben protección de
otros insensatos mejor dotados" (Luis Wu, Mundo Anillo)



pgsql-hackers by date:

Previous
From: Álvaro Herrera
Date:
Subject: Re: Trivial comment fix for tsquerysend()
Next
From: Dagfinn Ilmari Mannsåker
Date:
Subject: Re: add tab-complete for ALTER DOMAIN ADD...