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 1nIzrx-0007GM-1Z for pgsql-general@arkaria.postgresql.org; Sat, 12 Feb 2022 21:23:49 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nIzrv-0005Yx-T1 for pgsql-general@arkaria.postgresql.org; Sat, 12 Feb 2022 21:23:47 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nIzru-0005Yo-VL for pgsql-general@lists.postgresql.org; Sat, 12 Feb 2022 21:23:47 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nIzrq-0007qY-Uc for pgsql-general@lists.postgresql.org; Sat, 12 Feb 2022 21:23:46 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 8C3D85C0102 for ; Sat, 12 Feb 2022 16:23:40 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Sat, 12 Feb 2022 16:23:40 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm2; bh=/2LyFEBUOIANez dby5rr7thkpfc084VIvR5j9t7lWWI=; b=gGyd8JOK5GKD2RKKCpItEEOpErpYVd 9YMu8f4onA2i+rQlnPDkemlt8msT/6spz2BrZOfNkZXn2tgfcaSUxWAZpiWUfoFK y0/T2KM3hZcwM+492StB7C0nGL9zz3173xoASjf2ObfSvNplJGeotXFGcBGmM3nQ 100PY7VkvEXALJn7X7sCiYWwdaWMMI6CbeL0S35lQUl0oGpnZBYThRv+qx3st/qm 7EjouPO7/j+d3DS6Ymw2HEikDq8yXyybNTRAAYMoPGXu5N9CXutv3nu+/PM/ELqO e3YPgnz0XBGCCDFcbdPopbcBrYAjpjloSIu4ur3kS5PpOLGPSIzHt2OA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:date:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=/2LyFEBUOIANezdby5rr7thkpfc084VIvR5j9t7lWWI=; b=eOQdanUE PV+N1rjnBVmYwvnY3SweecE76umhxjMsHjDDeNahAwQMOCM4pfoSg3rFDDOmp+5S BPyBXZLywBR5cS7oNgI2e4Bu7wyrr0AY5Dm2tigh5Tu3nV6t6YWzQNk2xmtLK8JE PNz8ZNkN2XaILwzfJq/DMg3Fi+CwQNFuhBLPNgH22bI6iIKXN3qgidQQyTjO1lyA AboAHXW+U/XGomlQjmtv2YPIU7Bpst/w9ccsEGyBsKmmjzZiZ7KXpvr1I7oyuZH7 /YQIdHzVRhZ03AzNRuVXZ8K4rCYXuZYrD199wx0VLw0OexdjCGJpPNgMS8ws8kTf HtTs4s015TVpdA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrieehgddugeejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefkffggfgfuvfhfhfgjtgfgsehtke ertddtfeejnecuhfhrohhmpeetughrihgrnhcumfhlrghvvghruceorggurhhirghnrdhk lhgrvhgvrhesrghklhgrvhgvrhdrtghomheqnecuggftrfgrthhtvghrnhepudfgueelge evfffhgeeljeehhfettdegieelgefgheefffefveegjedtueetffdtnecuvehluhhsthgv rhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprggurhhirghnrdhklhgrvh gvrhesrghklhgrvhgvrhdrtghomh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Sat, 12 Feb 2022 16:23:40 -0500 (EST) Message-ID: Date: Sat, 12 Feb 2022 13:23:39 -0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.6.0 Subject: Re: Can we go beyond the standard to make Postgres radically better? Content-Language: en-US To: pgsql-general@lists.postgresql.org References: <7117322c-185c-4283-990d-6646d8476409@Spark> <20220210172229.4it7ioddvrtmws37@hjp.at> <20220212195057.amvpuhytkkcndyhh@hjp.at> <20220212211705.dnfqy6gcrwis2tkq@hjp.at> From: Adrian Klaver In-Reply-To: <20220212211705.dnfqy6gcrwis2tkq@hjp.at> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2/12/22 13:17, Peter J. Holzer wrote: > On 2022-02-12 20:50:57 +0100, Peter J. Holzer wrote: >> On 2022-02-12 01:18:04 +0100, Andreas 'ads' Scherbaum wrote: >>> On 10/02/2022 18:22, Peter J. Holzer wrote: >>>> On 2022-02-09 21:14:39 -0800, Guyren Howe wrote: >>>>> Examples of small things Postgres could have: >>>>> >>>>> • SELECT * - b.a_id from a natural join b >>>> >>>> My use case for such a feature are tables which contain one column (or a >>>> small number of columns) which you usually don't want to select: A bytea >>>> column or a very wide text column. In a program I don't mind (in fact I >>>> prefer) listing all the columns explicitely, but exploring a database >>>> interactively with psql typing lots of column names is tedious >>>> (especially since autocomplete doesn't work here). >>> >>> Maybe for this specific use case it's easier to teach psql how to do that, > [...] >> I think the easiest way to get the columns would be to EXPLAIN(verbose) >> the query. Otherwise psql (or whatever your shell is) would have to >> completely parse the SQL statement to find the columns. > > A shell could also provide an "expand select list" function using > explain. > > In fact, you can sort of do that manually: > > 1) Prefix your query with explain(verbose) > 2) Copy the "Output:" line of the top node. > 3) Edit your query, remove the explain(verbose) and replace the select > list with the content of the clipboard > 4) (optional) remove any unwanted columns Or: \pset format csv select * from cell_per limit 0; line_id,category,cell_per,ts_insert,ts_update,user_insert,user_update,plant_type,season,short_category Longer version: \pset format unaligned \pset fieldsep ',' select * from cell_per limit 0; line_id,category,cell_per,ts_insert,ts_update,user_insert,user_update,plant_type,season,short_category (0 rows) > > A bit cumbersome but less cumbersome than typing/copying lots of column > names from the result of a previous query or \d. > > hp > -- Adrian Klaver adrian.klaver@aklaver.com