Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uhUA9-000Vgp-29 for pgsql-hackers@arkaria.postgresql.org; Thu, 31 Jul 2025 14:21:41 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1uhUA8-001SlX-2n for pgsql-hackers@arkaria.postgresql.org; Thu, 31 Jul 2025 14:21:40 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uhUA7-001SlK-Ck for pgsql-hackers@lists.postgresql.org; Thu, 31 Jul 2025 14:21:39 +0000 Received: from fhigh-a1-smtp.messagingengine.com ([103.168.172.152]) by makus.postgresql.org with smtp (Exim 4.96) (envelope-from ) id 1uhUA4-0001gE-1K for pgsql-hackers@lists.postgresql.org; Thu, 31 Jul 2025 14:21:38 +0000 Received: from phl-compute-04.internal (phl-compute-04.phl.internal [10.202.2.44]) by mailfhigh.phl.internal (Postfix) with ESMTP id 289DD140024B; Thu, 31 Jul 2025 10:21:36 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-04.internal (MEProxy); Thu, 31 Jul 2025 10:21:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ilmari.org; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm2; t=1753971696; x=1754058096; bh=5wd1xds1v3O6dshYA+QIf3Aua6g8Op7LD+xqJTre1+k=; b= B2OeDmXPLa8rx5lKB7NjcHq3sSJNP3z/AObRcmRLLZ7i/E3ojw04SYIPB/OV3EE4 jBKf1cgXoUZqjOeDGnf/b0gCWRHoppwTzcVoMUDZWrdxNid/q562mRfEsIEOWvy0 Q4kt//qeaec8cGJzPHpCY0vssbia/m4EF+2/7MfcOXKwFuf6XmVz94yq2C9CIdZD NNyjIycg97sQpiqjwrgam8NN4uMUFGWTKfSjWkIX/w3sp8QEPSXAEp8L9MN5bMUJ 0bww1Xen8w7LIiix6lPhdW0dMtEI6MZLi62m/OYzSSQRG+LrMhYKU0NX4BqQqJca ogWSSabvsoyW+5VhPnAe9g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1753971696; x= 1754058096; bh=5wd1xds1v3O6dshYA+QIf3Aua6g8Op7LD+xqJTre1+k=; b=m 4TAzSrdUda0bwnlbuFGdzTRauIb93MPMu0VuOaI6WJH+TqBSfyvIflnEBTjhTrgp ClHjsDAbW3nwde6QQdo7DypqcmvMSiBKoz7Y9XreWrDXh5NqrW7GmNqtVQC5xm0W KPSucqe7W17z/drRacBAkLyfrVBfX/nw1x+XX2WDP5bRAWRwxM8uUvDWQQRZCxBy eIgGhFbzmXsRafu/XDM2AQtas1mGMRpwZqivxO0gfLJvhOFygt++iRHT4vAZlXCp JVKLTFv5UfEL2EFA5THS/aDFIu85w70caeXsOzKpNmCuGw3S4C2ErPc19jMx+y03 WcKgq/jcc7AZSOz7Ecnlg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdefgddutddutdegucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhephffvvefufhffjgfkfgggtgfgsehtkeertddtreejnecuhfhrohhmpeffrghgfhhi nhhnucfklhhmrghrihcuofgrnhhnshonkhgvrhcuoehilhhmrghrihesihhlmhgrrhhird horhhgqeenucggtffrrghtthgvrhhnpedtjeevueejgeejvdffuedujeethffhhefgtdfh ieejffekveekgfdtffejhfdtieenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmh epmhgrihhlfhhrohhmpehilhhmrghrihesihhlmhgrrhhirdhorhhgpdhnsggprhgtphht thhopeehpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopehpghhsqhhlqdhhrggtkh gvrhhssehlihhsthhsrdhpohhsthhgrhgvshhqlhdrohhrghdprhgtphhtthhopehtohhm rghsrdhvohhnughrrgesphhoshhtghhrvghsqhhlrdhorhhgpdhrtghpthhtohepthhhrg hrrghkrghnsehgmhgrihhlrdgtohhmpdhrtghpthhtohepjhhirghnrdhunhhivhgvrhhs rghlihhthiesghhmrghilhdrtghomhdprhgtphhtthhopehtohhmrghssehvohhnughrrg drmhgv X-ME-Proxy: Feedback-ID: i1ff147bf:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 31 Jul 2025 10:21:34 -0400 (EDT) From: =?utf-8?Q?Dagfinn_Ilmari_Manns=C3=A5ker?= To: Tomas Vondra Cc: jian he , Robins Tharakan , Tomas Vondra , pgsql-hackers@lists.postgresql.org Subject: Re: Fix tab completion in v18 for ALTER DATABASE/USER/ROLE ... RESET References: <87qzyghw2x.fsf@wibble.ilmari.org> <87ecu8iid7.fsf@wibble.ilmari.org> <54b435ab-ce2a-4a65-b4a9-35633dea2b28@vondra.me> <875xfahtik.fsf@wibble.ilmari.org> <48d5f407-3bfa-4518-9a73-22d1a6aa0544@vondra.me> Date: Thu, 31 Jul 2025 15:21:33 +0100 In-Reply-To: <48d5f407-3bfa-4518-9a73-22d1a6aa0544@vondra.me> (Tomas Vondra's message of "Thu, 31 Jul 2025 16:09:05 +0200") Message-ID: <87v7n8h24y.fsf@wibble.ilmari.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Tomas Vondra writes: > On 7/30/25 12:17, Dagfinn Ilmari Mannsåker wrote: >> >> ... >> >>> @@ -5015,7 +5021,8 @@ match_previous_words(int pattern_id, >>> /* Complete with a variable name */ >>> else if (TailMatches("SET|RESET") && >>> !TailMatches("UPDATE", MatchAny, "SET") && >>> - !TailMatches("ALTER", "DATABASE", MatchAny, "RESET")) >>> + !TailMatches("ALTER", "DATABASE", MatchAny, "RESET") && >>> + !TailMatches("ALTER", "USER|ROLE", MatchAny, "RESET")) >>> COMPLETE_WITH_QUERY_VERBATIM_PLUS(Query_for_list_of_set_vars, >>> "CONSTRAINTS", >>> "TRANSACTION", >> >> Instead of adding another !TailMatches() call, why not just change >> "DATABASE" to "DATABASE|ROLE|USER"? > > It seemed to me separate calls would be easier to understand, but I see > combine it like this in many other places, so done that way ... > > Pushed. Thanks! > Thanks for the fixes! > > regards