Re: [HACKERS] proposal: psql statements \gstore \gstore_binary (instead COPY RAW)

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема Re: [HACKERS] proposal: psql statements \gstore \gstore_binary (instead COPY RAW)
Дата
Msg-id CAFj8pRBtmhZ2phTXsLa5Oes5+E5wPk20b9d_7ZemKQJOx3hMwA@mail.gmail.com
обсуждение исходный текст
Ответ на [HACKERS] proposal: psql statements \gstore \gstore_binary (instead COPY RAW)  (Pavel Stehule <pavel.stehule@gmail.com>)
Ответы Re: [HACKERS] proposal: psql statements \gstore \gstore_binary (instead COPY RAW)
Список pgsql-hackers
Hi

2016-12-09 18:39 GMT+01:00 Pavel Stehule <pavel.stehule@gmail.com>:
Hi

Long time I am pushing a COPY RAW - without success.

Now I propose functionally similar solution - reduced to only to psql console

Now we have a statement \g for execution query, \gset for exec and store result in memory and I propose \gstore for storing result in file and \gstore_binary for storing result in file with binary passing. The query result should be one row, one column.

Usage:

SELECT image FROM accounts WHERE id = xxx
\gstore_binary ~/image.png

What do you think about this proposal?

here is a poc patch

Regards

Pavel

Usage:

postgres=# set client_encoding to 'latin2';
SET
Time: 1,561 ms
postgres=# select a from foo
postgres-# \gbstore ~/doc.xml
Time: 1,749 ms

content of doc.xml
<?xml version="1.0" encoding="LATIN2"?><a>příliš žluťoučký kůň se napil žluté vody</a>


Regards

Pavel

Вложения

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

Предыдущее
От: Kevin Grittner
Дата:
Сообщение: Re: [HACKERS] snapbuild woes
Следующее
От: Mateusz Stefek
Дата:
Сообщение: [HACKERS] Optimization for index-only scans with filter conditions