Re: add tab-complete for ALTER DOMAIN ADD...

Álvaro Herrera <alvherre@kurilemu.de>

From: Álvaro Herrera <alvherre@kurilemu.de>
To: Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>
Cc: jian he <jian.universality@gmail.com>, PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2025-05-11T14:22:09Z
Lists: 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)



Commits

  1. Add tab-completion for ALTER TABLE not-nulls

  2. Add tab-complete for ALTER DOMAIN ADD [CONSTRAINT]