Re: [GENERAL] Importing binary data

2014-10-27 Thread Chris Ruprecht
Thanks guys. I know what I will spend the night, doing ;). > On Oct 27, 2014, at 16:33 , Tom Lane wrote: > > Chris Ruprecht writes: >> I can export the data out of that database into flat files just fine, but >> then I try to import the data to Postgres, I'm getting errors like this: > >> ER

Re: [GENERAL] Importing binary data

2014-10-27 Thread Tom Lane
Chris Ruprecht writes: > I can export the data out of that database into flat files just fine, but > then I try to import the data to Postgres, I'm getting errors like this: > ERROR: invalid byte sequence for encoding "SQL_ASCII": 0x00 > CONTEXT: COPY attachments, line 14: "58025 1 c

Re: [GENERAL] Importing binary data

2014-10-27 Thread Chris Ruprecht
I'm using psql mydb # copy attachments FROM '/opt/tmp/clientdata/sql-data-p/attachments.dat' with NULL as 'NULL'; to load the database back in. The psql command runs on the same box as the DB server. If I had my way, I'd store the binary somewhere and keep a reference to it in the database

Re: [GENERAL] Importing binary data

2014-10-27 Thread David G Johnston
Chris Ruprecht-3 wrote > Hey guys, > > I was given a database back of a non-PostgreSQL database. That database > contains records where some binary file (looks like email attachments) was > imported into several chunks of X characters in length and then stored > into multiple records. A messy way