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 1oy12b-0002ns-BB for pgsql-general@arkaria.postgresql.org; Thu, 24 Nov 2022 01:28:37 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oy12a-00083n-4A for pgsql-general@arkaria.postgresql.org; Thu, 24 Nov 2022 01:28:36 +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 1oy12Z-00082l-QA for pgsql-general@lists.postgresql.org; Thu, 24 Nov 2022 01:28:35 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oy12X-00034g-8L for pgsql-general@lists.postgresql.org; Thu, 24 Nov 2022 01:28:34 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 2AO1STTN3769353; Wed, 23 Nov 2022 20:28:29 -0500 From: Tom Lane To: Andres Freund cc: Thomas Munro , Kirk Wolak , pgsql-general@lists.postgresql.org Subject: Re: Getting PSQL in Windows to support TAB/Autocomplete via modified readline... In-reply-to: <20221124004144.iosgze2qnmcctgsh@awork3.anarazel.de> References: <3168699.1669046286@sss.pgh.pa.us> <20221123230256.m23somxrmvdyoimk@awork3.anarazel.de> <3755435.1669245082@sss.pgh.pa.us> <20221124004144.iosgze2qnmcctgsh@awork3.anarazel.de> Comments: In-reply-to Andres Freund message dated "Wed, 23 Nov 2022 16:41:44 -0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3769351.1669253309.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Wed, 23 Nov 2022 20:28:29 -0500 Message-ID: <3769352.1669253309@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Andres Freund writes: > On 2022-11-23 18:11:22 -0500, Tom Lane wrote: >> Huh ... do you recall the details? Large as tab-complete is, it's >> far smaller than gram.y: > So It might just be that we need to split up that very long "else if" ch= ain in > psql_completion(). Could be, yeah. Related point: I've wondered for awhile how long that chain can get before we start noticing performance issues on slower machines. Even when the standard is just human reaction time, there's a limit to how many cycles you can throw away. So I'd like to see it refactored somehow to be a bit less stupid --- but I have a nagging feeling that we'd end up building some special-purpose program generator, which is something I've not wanted to do. OTOH, in the best of all possible worlds such a tool might make it easier to add tab completions? (In the past I've fantasized about auto-generating tab completion logic from the backend grammar, but I fear it's just fantasy. The backend grammar isn't factored right, and too many of its names don't have clear traceability to what-kind-of-object-is-that.) regards, tom lane