Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o850G-0006E2-11 for pgsql-hackers@arkaria.postgresql.org; Sun, 03 Jul 2022 19:11:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1o850D-0008Mo-Rx for pgsql-hackers@arkaria.postgresql.org; Sun, 03 Jul 2022 19:11:29 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o850D-0008Md-7M for pgsql-hackers@lists.postgresql.org; Sun, 03 Jul 2022 19:11:29 +0000 Received: from mail-oa1-x35.google.com ([2001:4860:4864:20::35]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1o850A-0003ql-Bh for pgsql-hackers@lists.postgresql.org; Sun, 03 Jul 2022 19:11:27 +0000 Received: by mail-oa1-x35.google.com with SMTP id 586e51a60fabf-101dc639636so10550591fac.6 for ; Sun, 03 Jul 2022 12:11:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=leadboat.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=k4MNtesQr5I2oUZwgc5ixyajVkI12oixzkhi4U3Ou8U=; b=Hhipsqx3YxbBp21VFifVib8ZPEooSdPMYdAQEyDVd3UCoOo72VRz1mEAjwvGoHmE+i aGwW6r//E4cHbDinzq+vC0wWONWkSmRhaoe2V40TC29mnBJdEhroZRRSibn/+YfEgRFB ktqYpZp1PlCD2Xcv+m7wBXaqXVf3PPUt4tH0o= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=k4MNtesQr5I2oUZwgc5ixyajVkI12oixzkhi4U3Ou8U=; b=J67F1Z3oI9jiWEx2RVzqYgbmPYvjcKZCV+igXB54Eh5MXSFGKZ22eAxFVT5l1LKH3k RngSx9pa+EyQKC0cPM0K9DNZrWmHwRZFVJtDLC5QjmxiZOes275R0Zp7U6qd4zTi2438 DsjpV9+JwX8crKT8AdCxWfUn/FCtBgSCDdoXLQq/ZzrH65dVv0dU9FHmLRrszN+Q0FFt kgW9sXGomowrIkYIwP0fpEyBv4QW+N/bUArHVaAIYkAqqNFTiebkIkdsf452ReovHLEq 0LkJmw0pslhxzvx7AZt3KxvCQ86CIn3HrZCDTfaJ9GsCzMFS55g0og/BcF3ys8SgVaQW +zTA== X-Gm-Message-State: AJIora+d5aTJbvPlZuE/W28V7zky9TqF30MNdr0mjVsy4OQGH9YUsxqo VGqmL6ddlZBNfVT52GSxpow6gA== X-Google-Smtp-Source: AGRyM1vp56x3B2xoefgMXLzheenyHbUduJ6l11Q/+WRf0rHXHzQN4N0JCBGd1BNc44W0TyMHiBC9+A== X-Received: by 2002:a05:6870:14c7:b0:f2:c44c:d054 with SMTP id l7-20020a05687014c700b000f2c44cd054mr4579527oab.70.1656875485645; Sun, 03 Jul 2022 12:11:25 -0700 (PDT) Received: from rfd.leadboat.com ([2600:1702:a20:5750::2e]) by smtp.gmail.com with ESMTPSA id y203-20020aca4bd4000000b0032eb81e352asm13813965oia.38.2022.07.03.12.11.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 03 Jul 2022 12:11:24 -0700 (PDT) Date: Sun, 3 Jul 2022 12:11:22 -0700 From: Noah Misch To: Tom Lane Cc: Jeff Janes , PostgreSQL Hackers Subject: Re: 15beta1 tab completion of extension versions Message-ID: <20220703191122.GA2520965@rfd.leadboat.com> References: <1803867.1655596168@sss.pgh.pa.us> <1930937.1655614573@sss.pgh.pa.us> <20220703083217.GB2476530@rfd.leadboat.com> <1212507.1656858578@sss.pgh.pa.us> <1285253.1656871259@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1285253.1656871259@sss.pgh.pa.us> User-Agent: Mutt/1.5.24 (2015-08-30) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Sun, Jul 03, 2022 at 02:00:59PM -0400, Tom Lane wrote: > I wrote: > > Noah Misch writes: > >> "ALTER EXTENSION hstore UPDATE;" is a valid command (updates to the > >> control file default version). Hence, I think the v14 behavior was better. > > > Hmm ... good point, let me think about that. > > After consideration, my preferred solution is just this: > > diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c > index 463cac9fb0..c5cafe6f4b 100644 > --- a/src/bin/psql/tab-complete.c > +++ b/src/bin/psql/tab-complete.c > @@ -1927,7 +1927,7 @@ psql_completion(const char *text, int start, int end) > > /* ALTER EXTENSION */ > else if (Matches("ALTER", "EXTENSION", MatchAny)) > - COMPLETE_WITH("ADD", "DROP", "UPDATE TO", "SET SCHEMA"); > + COMPLETE_WITH("ADD", "DROP", "UPDATE", "SET SCHEMA"); > > /* ALTER EXTENSION UPDATE */ > else if (Matches("ALTER", "EXTENSION", MatchAny, "UPDATE")) > > This will require one extra when what you want is to update to > a specific version, but I doubt that that's going to bother anyone > very much. I don't want to try to resurrect the v14 behavior exactly > because it's too much of a mess from a quoting standpoint. Works for me, and I agree the patch implements that successfully. "ALTER EXTENSION x UPDATE;" is an infrequent command, and "ALTER EXTENSION x UPDATE TO ..." is even less frequent. It's not worth much special effort to shave steps.