Re: [GENERAL] I want the stupidest possible binary export

2014-09-18 Thread David Rysdam
Jov writes: > psql can only input/output text string,which can not be binary content。with > 9.2,you can encode bytea to base64,save to file,then use shell command to > decode the file。 This worked, btw. Encoded to base64, piped to sed to fix the newlines, piped to 'base64 -id' and then to file.

Re: [GENERAL] I want the stupidest possible binary export

2014-09-18 Thread Nicklas Avén
-09-18 16:55 (GMT+01:00) Till: David Rysdam ,pgsql-general Rubrik: Re: [GENERAL] I want the stupidest possible binary export psql can only input/output text string,which can not be binary content。with 9.2,you can encode bytea to base64,save to file,then use shell command to decode the file

Re: [GENERAL] I want the stupidest possible binary export

2014-09-18 Thread David Rysdam
Jov writes: > psql can only input/output text string,which can not be binary content。with > 9.2,you can encode bytea to base64,save to file,then use shell command to > decode the file。 > google “amutu.com pg bytea” can get a blog post。 I wondered if I could do that. OK, will try it, thanks. smi

Re: [GENERAL] I want the stupidest possible binary export

2014-09-18 Thread David Rysdam
Adrian Klaver writes: >> psql -t -c "\copy (select mybinaryfield from mytable where key = 1) to >> 'file'" with format binary > > From here: > > http://www.postgresql.org/docs/9.2/static/app-psql.html > > the above should be: > > psql -t -c "\copy (select mybinaryfield from mytable wher

Re: [GENERAL] I want the stupidest possible binary export

2014-09-18 Thread Jov
psql can only input/output text string,which can not be binary content。with 9.2,you can encode bytea to base64,save to file,then use shell command to decode the file。 google “amutu.com pg bytea” can get a blog post。 with upcoming 9.4,you can change bytea to large object,then use lo_* psql cmd save

Re: [GENERAL] I want the stupidest possible binary export

2014-09-18 Thread Adrian Klaver
On 09/18/2014 07:06 AM, David Rysdam wrote: I've got a some tables with bytea fields that I want to export only the binary data to files. (Each field has a gzipped data file.) I really want to avoid adding overhead to my project by writing a special program to do this, so I'm trying to do it fro

Re: [GENERAL] I want the stupidest possible binary export

2014-09-18 Thread Szymon Guz
On 18 September 2014 16:06, David Rysdam wrote: > I've got a some tables with bytea fields that I want to export only the > binary data to files. (Each field has a gzipped data file.) > > I really want to avoid adding overhead to my project by writing a > special program to do this, so I'm trying