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 1nJ0OE-0001ox-Rx for pgsql-general@arkaria.postgresql.org; Sat, 12 Feb 2022 21:57:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nJ0OD-0006NF-Nh for pgsql-general@arkaria.postgresql.org; Sat, 12 Feb 2022 21:57:09 +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 1nJ0OD-0006N2-DV for pgsql-general@lists.postgresql.org; Sat, 12 Feb 2022 21:57:09 +0000 Received: from mail.hjp.at ([212.17.106.138] helo=rorschach.hjp.at) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nJ0O9-0004Ei-Ac for pgsql-general@lists.postgresql.org; Sat, 12 Feb 2022 21:57:08 +0000 Received: by rorschach.hjp.at (Postfix, from userid 1000) id DBA1464A6; Sat, 12 Feb 2022 22:57:02 +0100 (CET) Date: Sat, 12 Feb 2022 22:57:02 +0100 From: "Peter J. Holzer" To: pgsql-general@lists.postgresql.org Subject: Re: Can we go beyond the standard to make Postgres radically better? Message-ID: <20220212215702.shdf2pmoshlflh6z@hjp.at> Mail-Followup-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> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="mfzpybq4x6b3eyda" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --mfzpybq4x6b3eyda Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2022-02-12 13:23:39 -0800, Adrian Klaver wrote: > On 2/12/22 13:17, Peter J. Holzer wrote: > > A shell could also provide an "expand select list" function using > > explain. > >=20 > > In fact, you can sort of do that manually: > >=20 > > 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 >=20 > Or: >=20 > \pset format csv >=20 > select * from cell_per limit 0; >=20 > line_id,category,cell_per,ts_insert,ts_update,user_insert,user_update,pla= nt_type,season,short_category Good idea. Even better: select * from cell_per limit 0 \g (format=3Dcsv) Saves you having to stash the query somewhere. (You still have to look out for duplicate column names, though) hp --=20 _ | Peter J. Holzer | Story must make more sense than reality. |_|_) | | | | | hjp@hjp.at | -- Charles Stross, "Creative writing __/ | http://www.hjp.at/ | challenge!" --mfzpybq4x6b3eyda Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEETtJbRjyPwVTYGJ5k8g5IURL+KF0FAmIILSoACgkQ8g5IURL+ KF0JcQ//QsqFx0VZWxEsY0LZVlNd/LakqagY6aaqoMoewyR/S9HVBaVfFGRaXjPI L/n3DrQ+wPoV3KhJl3NJpigHRVet5ydNPUjt1tYn7rGjpZU0l8DyBfzz+gBHBbFu Cba5ZZRu0dLnzTyke7yOBPT3XpadmTLcm2gfuKbprdrP+OjgHDzxpfNzfGHWYCh0 kGEn8jrEWNfmRT949zvkMyt2O/jZBsmplvcG+L+hUHnD2ymC+owjUmyT/IbtL8Il D0IjUwWY1lwvD4NaJOH2TLgWpjULXR/ub8bFJ5qnmNG2z5Ey2sMFLiDbIB/FvHFC Atf4PLylMNfJY6Hl80GHtad4iXxF9JH2w6yDfUP/AJbU73mP7bbfKAMaAR7+LAZm JZ1rAxrk2LvQv9kNro5wO6NZbDrYEI/FyOLEdIjQX9flpQrqj409mU2/TyvPX8+h rOulatvVa1tudE6vjYnBp3wSdJwxwWttOZcNiqIoER+D4ZuFkMwNZwdc8h1rtOsi z6vMe2vLSdN6HFOrLuJGovu9tWzgSiyk7GEu84mCHt2pjBzbOq0r8frUxTXH6JrV vL42fhKG6ktiZQKcIaqj/wtOaTUQ/KoPxHTanoBhPhwTMEQY4LSJFJdi5CknAjDE b8z5byN84XbuzWb15P6bybUaU+v87izmEDuCcWxPb6ovwxpFgEE= =+HpZ -----END PGP SIGNATURE----- --mfzpybq4x6b3eyda--