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 1oy2Qr-00074B-PZ for pgsql-general@arkaria.postgresql.org; Thu, 24 Nov 2022 02:57:45 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oy2Qq-0002cY-8g for pgsql-general@arkaria.postgresql.org; Thu, 24 Nov 2022 02:57:44 +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 1oy2Qp-0002b1-UA for pgsql-general@lists.postgresql.org; Thu, 24 Nov 2022 02:57:43 +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 1oy2Qg-0003o3-9r for pgsql-general@lists.postgresql.org; Thu, 24 Nov 2022 02:57:39 +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 2AO2vUqN3778128; Wed, 23 Nov 2022 21:57:30 -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: <20221124022205.2uv6lz74qfo7rebn@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> <3769352.1669253309@sss.pgh.pa.us> <20221124022205.2uv6lz74qfo7rebn@awork3.anarazel.de> Comments: In-reply-to Andres Freund message dated "Wed, 23 Nov 2022 18:22:05 -0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3778126.1669258650.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Wed, 23 Nov 2022 21:57:30 -0500 Message-ID: <3778127.1669258650@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Andres Freund writes: > I think it'd be easier to deal with this if COMPLETE_WITH_* caused the t= he > containing function to return. Then the completions wouldn't need to be = in one > huge if-else if. Leaving msvc aside, that also seems nice for efficiency= . Yeah, that could be an easy quick-fix. We'd need to refactor so that the cleanup housekeeping at the bottom of psql_completion() was in a wrapper function, but perhaps that wouldn't be too messy. regards, tom lane