From: | "Peter J(dot) Holzer" <hjp-pgsql(at)hjp(dot)at> |
---|---|
To: | pgsql-general(at)lists(dot)postgresql(dot)org |
Subject: | Re: Can we go beyond the standard to make Postgres radically better? |
Date: | 2022-02-12 21:57:02 |
Message-ID: | 20220212215702.shdf2pmoshlflh6z@hjp.at |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
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(at)hjp(dot)at | -- Charles Stross, "Creative writing
__/ | http://www.hjp.at/ | challenge!"
From | Date | Subject | |
---|---|---|---|
Next Message | Andrus | 2022-02-12 22:04:13 | How to split normal and overtime hours |
Previous Message | Peter J. Holzer | 2022-02-12 21:34:53 | Re: Can we go beyond the standard to make Postgres radically better? |