Re: [HACKERS] proposal: psql statements \gstore \gstore_binary(instead COPY RAW) - Mailing list pgsql-hackers

From Pavel Stehule
Subject Re: [HACKERS] proposal: psql statements \gstore \gstore_binary(instead COPY RAW)
Date
Msg-id CAFj8pRCMzXkgcMW+qTdZWabZ32XgFoKOTAKULvkO98qO_VnwQA@mail.gmail.com
Whole thread Raw
In response to Re: [HACKERS] proposal: psql statements \gstore \gstore_binary(instead COPY RAW)  (Oleksandr Shulgin <oleksandr.shulgin@zalando.de>)
List pgsql-hackers


2016-12-09 19:48 GMT+01:00 Oleksandr Shulgin <oleksandr.shulgin@zalando.de>:
On Dec 9, 2016 18:40, "Pavel Stehule" <pavel.stehule@gmail.com> wrote:
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?

I might be missing something, but is it different from:

\t
\a
\o output_filename
SELECT ...
\o

?


The \gstore is same like these commands - but it is user friendly - one liner statement.

For \gstore_binary there is not any workaround

Pavel
 
--
Alex



pgsql-hackers by date:

Previous
From: Oleksandr Shulgin
Date:
Subject: Re: [HACKERS] proposal: psql statements \gstore \gstore_binary(instead COPY RAW)
Next
From: Jeff Janes
Date:
Subject: Re: [HACKERS] new table partitioning breaks \d table to older versions