Re: Can we go beyond the standard to make Postgres radically better?

Поиск
Список
Период
Сортировка
От Peter J. Holzer
Тема Re: Can we go beyond the standard to make Postgres radically better?
Дата
Msg-id 20220212215702.shdf2pmoshlflh6z@hjp.at
обсуждение исходный текст
Ответ на Re: Can we go beyond the standard to make Postgres radically better?  (Adrian Klaver <adrian.klaver@aklaver.com>)
Список 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@hjp.at         |    -- Charles Stross, "Creative writing
__/   | http://www.hjp.at/ |       challenge!"

Вложения

В списке pgsql-general по дате отправления:

Предыдущее
От: "Peter J. Holzer"
Дата:
Сообщение: Re: Can we go beyond the standard to make Postgres radically better?
Следующее
От: Andrus
Дата:
Сообщение: How to split normal and overtime hours