pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter J. Holzer <hjp-pgsql@hjp.at>
To: pgsql-general@lists.postgresql.org
Subject: Re: Can we go beyond the standard to make Postgres radically better?
Date: Sat, 12 Feb 2022 22:57:02 +0100
Message-ID: <20220212215702.shdf2pmoshlflh6z@hjp.at> (raw)
In-Reply-To: <da1c840d-ff3a-31fd-fd9f-e27a51572339@aklaver.com>
References: <7117322c-185c-4283-990d-6646d8476409@Spark>
	<F04BD036-073C-42AD-B308-43D21C75024B@gmail.com>
	<20220210172229.4it7ioddvrtmws37@hjp.at>
	<eafc22b5-703d-2993-b4bc-4edad404f63f@pgug.de>
	<20220212195057.amvpuhytkkcndyhh@hjp.at>
	<20220212211705.dnfqy6gcrwis2tkq@hjp.at>
	<da1c840d-ff3a-31fd-fd9f-e27a51572339@aklaver.com>

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.
> > 
> > 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

Good idea. Even better:

select * from cell_per limit 0 \g (format=csv)

Saves you having to stash the query somewhere.

(You still have to look out for duplicate column names, though)

        hp

-- 
   _  | Peter J. Holzer    | Story must make more sense than reality.
|_|_) |                    |
| |   | hjp@hjp.at         |    -- Charles Stross, "Creative writing
__/   | http://www.hjp.at/ |       challenge!"

Attachments:

  signature.asc (application/pgp-signature, 832B) download

view thread (50+ messages)  latest in thread

Message-ID: <20220212215702.shdf2pmoshlflh6z@hjp.at>
Permalink:  ../20220212215702.shdf2pmoshlflh6z@hjp.at/
Also on:    postgresql.org/message-id/20220212215702.shdf2pmoshlflh6z@hjp.at

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: hjp-pgsql@hjp.at
  Subject: Re: Can we go beyond the standard to make Postgres radically better?
  In-Reply-To: <20220212215702.shdf2pmoshlflh6z@hjp.at>
  References: <7117322c-185c-4283-990d-6646d8476409@Spark> <F04BD036-073C-42AD-B308-43D21C75024B@gmail.com> <20220210172229.4it7ioddvrtmws37@hjp.at> <eafc22b5-703d-2993-b4bc-4edad404f63f@pgug.de> <20220212195057.amvpuhytkkcndyhh@hjp.at> <20220212211705.dnfqy6gcrwis2tkq@hjp.at> <da1c840d-ff3a-31fd-fd9f-e27a51572339@aklaver.com> <20220212215702.shdf2pmoshlflh6z@hjp.at>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox