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

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: proposal: psql statements \gstore \gstore_binary (instead COPY RAW)
Date: 2016-12-12 06:20:19
Message-ID: CAFj8pRBchJEaTKMGvko5FqCUr9BhDPdBcsBF0GRyRZUBQxwx-Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2016-12-11 18:23 GMT+01:00 Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>:

> Hi
>
> 2016-12-09 18:39 GMT+01:00 Pavel Stehule <pavel(dot)stehule(at)gmail(dot)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>
>
>
second update - + doc

the export import regress tests are little bit heavy - I'll write it for
loading content file together.

Regards

Pavel

>
>> Regards
>>
>> Pavel
>>
>
>

Attachment Content-Type Size
psql-gstore-01.patch text/x-patch 9.7 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2016-12-12 06:34:27 Re: Broken SSL tests in master
Previous Message Michael Paquier 2016-12-12 05:18:09 Re: pgcrypto compilation error due to stack-allocated EVP_CIPHER_CTX