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 1oNxKo-0005qh-NU for pgsql-general@arkaria.postgresql.org; Tue, 16 Aug 2022 14:14:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oNxKn-0008JF-LB for pgsql-general@arkaria.postgresql.org; Tue, 16 Aug 2022 14:14:21 +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 1oNxKn-0008J6-Av for pgsql-general@lists.postgresql.org; Tue, 16 Aug 2022 14:14:21 +0000 Received: from lana.depesz.com ([88.198.49.178] helo=depesz.com) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oNxKh-0001wF-Jq for pgsql-general@lists.postgresql.org; Tue, 16 Aug 2022 14:14:19 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=depesz.com; s=20170201; h=In-Reply-To:Content-Type:MIME-Version:References:Reply-To: Message-ID:Subject:Cc:To:Sender:From:Date:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=4ivDTLJEPihNH6h+6npV/sLigPjr1X/ilDmbb82rqLA=; b=GoNtk7JYar6qq1Ep6xRFfBHmi1 GfaFJ+Bv6TdBki6M0z/XFS1jSGx1QTLu3CYa18gDBPMA+iZ0R2+9bUKr3EBcmbPpmpfly9b4JahR3 /keRM8xncNjAIHuqVakPKTmOTY80cmbC2bNTFYITqun0vG8MiTv7I3fismWNYXLv1ihg=; Received: from lana.depesz.com ([88.198.49.178] helo=depesz.com) by depesz.com with esmtpa (Exim 4.92) (envelope-from ) id 1oNxKe-0006Tm-M8; Tue, 16 Aug 2022 16:14:12 +0200 Date: Tue, 16 Aug 2022 16:14:12 +0200 From: hubert depesz lubaczewski Sender: depesz@depesz.com To: Tom Lane Cc: Ron , pgsql-general@lists.postgresql.org Subject: Re: Would it be possible to add functions to tab-completion in psql? Message-ID: <20220816141412.GA22751@depesz.com> Reply-To: depesz@depesz.com References: <20220816122849.GC24417@depesz.com> <20220816130114.GA22122@depesz.com> <2bdacb77-c22f-8be5-cbb7-418c1e3eab82@gmail.com> <20220816140253.GB14225@depesz.com> <1122768.1660659055@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1122768.1660659055@sss.pgh.pa.us> User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, Aug 16, 2022 at 10:10:55AM -0400, Tom Lane wrote: > There is nothing principled about assuming that the first word > after SELECT is a function name. It'd be even less principled to > provide tab completion only for function names beginning with > "pg_". So this idea seems like a wart rather than something > anybody would think is a nice improvement. While I understand that there is nothing that would suggest it, is there any reason why providing a thing that can legally be there would be bad idea? I understand that someone might want to enter pg_or_not_pg (column name from some table), or perhaps pg.some_column_name - but what is the harm of providing pg_* functions for pg_? Specifically, I'd ask what is the harm of increasing what tab completion can do by a lot - for example, make it tab-complete fields from all tables. And make it possible to tab-complete column name anywhere in where clause. But function name in select would be (for me(!)) great first step, and I can't really see the drawbacks, aside from using developer time to work on it. Best regards, depesz