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 1uPIM7-004LkT-8p for pgsql-hackers@arkaria.postgresql.org; Wed, 11 Jun 2025 10:06:51 +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 1uPIM4-001r6c-7O for pgsql-hackers@arkaria.postgresql.org; Wed, 11 Jun 2025 10:06:48 +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 1uPIM3-001r6U-M2 for pgsql-hackers@lists.postgresql.org; Wed, 11 Jun 2025 10:06:48 +0000 Received: from fhigh-a3-smtp.messagingengine.com ([103.168.172.154]) by makus.postgresql.org with smtp (Exim 4.96) (envelope-from ) id 1uPIM2-001PXo-0v for pgsql-hackers@postgresql.org; Wed, 11 Jun 2025 10:06:47 +0000 Received: from phl-compute-12.internal (phl-compute-12.phl.internal [10.202.2.52]) by mailfhigh.phl.internal (Postfix) with ESMTP id 079CF114009F; Wed, 11 Jun 2025 06:06:45 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-12.internal (MEProxy); Wed, 11 Jun 2025 06:06:45 -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=fm3; t=1749636405; x=1749722805; bh=6QUkFg1ZgEBvOYYsRhRuKUMkS0OhgnMLsrIc5jaPfKg=; b= GZHIQuHau+RTQ5F4xurXWQqeGUpPoLffhTA3Iybld314WkgAOq8XavdlZvPBUSx0 7NT8xHaKsn1HKCFQO9iLodWrlY3uAtxC/Cs9K9mzpRMNT+25zMjeZEHyNsbcXTj0 dRh7YV24B8u4xk9T1/mQDn52v3QevcXaTBskWsvvYshSuA9rQXX41KU7jrw50nU+ Rkl2xZtwnGZ8cp8yCS30shIaVGZ0aHJ62cV8vtpdNLMf29xGxp+/Tvzi6ynFoQuV ugczJ0QujUwlXiY2bzEL45bQMLOtBulZfvtFL6hhBEm6SDMcohZW4Zz+59F3Cuhn +bF1hzU3a9sq2fjyfc6Xlw== 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=fm1; t=1749636405; x= 1749722805; bh=6QUkFg1ZgEBvOYYsRhRuKUMkS0OhgnMLsrIc5jaPfKg=; b=k tYnnwXtXfChiMSRQp/9Sf7KL4SDJHn4EBSVVJHTSFLlOCTaG1cr/N6kgALPUd9io 9OVD7imnSvwKYC7UfOQsN3M7zTOnFTES88hznbC0svVN1sZIXcODZVa5OnVGszFC fsgecN5tLFZQMyTEYjHknCL9F/eVjOyLqablymiMBMLDXPfB8xk3lQ1UxKG8Cb+5 Nf6MtIvwqZqAT2t40AIetL+FdEj0J5psnd2PQ1PqRTksPnIdT8SaZCe9KouAEPv9 XWdPP0krpOpIhqNmKDNG1XSdZvHrcUt9e6r2YQf2uOXuMc72j04HyrQdIGd5wgeA pboh9hjy/J0ncnQSsXv+A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtddugdduvddtgecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpefhvfevufhfffgjkfgfgggtgfesthekredttder jeenucfhrhhomhepffgrghhfihhnnhcukfhlmhgrrhhiucforghnnhhsnohkvghruceoih hlmhgrrhhisehilhhmrghrihdrohhrgheqnecuggftrfgrthhtvghrnhepfeehteetveel tdduueduffdvtdeuudejueethefgleegtdeftdefleehkefgudfgnecuffhomhgrihhnpe hpohhsthhgrhdrvghsnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghi lhhfrhhomhepihhlmhgrrhhisehilhhmrghrihdrohhrghdpnhgspghrtghpthhtohepvd dpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepphhgshhqlhdqhhgrtghkvghrshes phhoshhtghhrvghsqhhlrdhorhhgpdhrtghpthhtohepphgvthgvrhesvghishgvnhhtrh gruhhtrdhorhhg X-ME-Proxy: Feedback-ID: i1ff147bf:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 11 Jun 2025 06:06:44 -0400 (EDT) From: =?utf-8?Q?Dagfinn_Ilmari_Manns=C3=A5ker?= To: Peter Eisentraut Cc: pgsql-hackers@postgresql.org Subject: Re: Improve tab completion for various SET/RESET forms References: <87bjqwwtic.fsf@wibble.ilmari.org> <18691637-2af2-4a2f-9f12-8201c2a88206@eisentraut.org> Date: Wed, 11 Jun 2025 11:06:42 +0100 In-Reply-To: <18691637-2af2-4a2f-9f12-8201c2a88206@eisentraut.org> (Peter Eisentraut's message of "Wed, 11 Jun 2025 10:34:44 +0200") Message-ID: <871prqwq19.fsf@wibble.ilmari.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (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 Peter Eisentraut writes: > On 09.06.25 22:27, Dagfinn Ilmari Mannsåker wrote: >> I noticed that psql tab-completes every possible session-settable >> variable after RESET, not just the ones that have actually been set in >> the current session. However, as I was fixing that I noticed several >> other deficiencies around other forms of SET/RESET. So, here's the >> resulting yak stack. > > These technical changes seem fine, but I haven't looked in detail. But > I want to say that I don't like this proposed behavior change at all. This is not the first case of behaviour like this: there's precedence for it for ALTER DATABASE ... RESET and ALTER ROLE ... RESET (but that was buggy and is fixed by the first patch in the series): they only complete variables that are actually set on the relevant entity. See the thread at https://postgr.es/m/CAEP4nAzqiT6VbVC5r3nq5byLTnPzjniVGzEMpYcnAHQyNzEuaw%40mail.gmail.com Why should the session be any different? > don't think tab completion should filter out by things that are probably > not interesting or useful depending on session state. That could be > very confusing, especially since there is no surface to explain this > anywhere. The obvious extreme case is that RESET in a fresh session > wouldn't offer any completions at all. That's not the case, as mentioned in the commit message for the final patch: it also completes with the keywords ALL, ROLE and SESSION (which will subsequently be completed with AUTHORIZATION). Also, it's a handy way of seeing which variables have been set in the current session, withouth having to query pg_settings manually. - ilmari