|From:||Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>|
|To:||Stephen Frost <sfrost(at)snowman(dot)net>|
|Cc:||"Jason O'Donnell" <odonnelljp01(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>|
|Subject:||Re: new set of psql patches for loading (saving) data from (to) text, binary files|
|Views:||Raw Message | Whole Thread | Download mbox|
> > > There's a whitespace-only hunk that shouldn't be included.
> > >
> > > I don't agree with the single-column/single-row restriction on these.
> > > can certainly see a case where someone might want to, say, dump out a
> > > bunch of binary integers into a file for later processing.
> > >
> > > The tab-completion for 'gstore' wasn't correct (you didn't include the
> > > double-backslash). The patch also has conflicts against current master
> > > now.
> > >
> > > I guess my thinking about moving this forward would be to simplify it
> > > just '\gb' which will pull the data from the server side in binary
> > > format and dump it out to the filename or command given. If there's a
> > > new patch with those changes, I'll try to find time to look at it.
> > ok I'll prepare patch
> Great, thanks!
I rewrote these patches - it allows binary export/import from psql and the
code is very simple. The size of the patch is bigger due including 4KB
binary file (in hex format 8KB).
What is done:
create table foo foo(a bytea);
insert into foo values($1)
\gloadfrom ~/xxx.jpg bytea
\pset format binary
select a from foo
tested on import 55MB binary file
Available import formats are limited to text, bytea, xml - these formats
are safe for receiving data via recv function.
|Next Message||Robert Haas||2017-03-18 17:10:52||Re: background sessions|
|Previous Message||Tom Lane||2017-03-18 16:50:40||Re: New CORRESPONDING clause design|