Re: Importing directly from BCP files - Mailing list pgsql-general

From Tim Uckun
Subject Re: Importing directly from BCP files
Date
Msg-id CAGuHJrM1xMagmX0Lgwv2BymSegyix7CdXqf82Pw0Dk3W0B6o3Q@mail.gmail.com
Whole thread Raw
In response to Re: Importing directly from BCP files  (David Rowley <david.rowley@2ndquadrant.com>)
Responses Re: Importing directly from BCP files  (Alvaro Herrera <alvherre@2ndquadrant.com>)
List pgsql-general

That appears to depend on the -f option


I have the format files so that's good.

 

Have you tried opening a file in a text editor to see what they look like?
 

Yes. It looks like a binary file with lots of non printable characters. I tried running it through iconv with common encodings (windows-1524, utf-16, utf-32 and few others) but I can't seem to get a clean UTF-8 or ASCII conversion for some reason.


The bulk import command in PostgreSQL is COPY, so you'll likely want to look at http://www.postgresql.org/docs/9.4/static/sql-copy.html 


I need to get them into a shape where copy command can process them first I think.  


 
Has anybody done anything like this before?


I'd imagine that it's fairly common.


I googled for quite a while and couldn't find anything.  Unfortunately the -f "format" option makes it hard to search for "BCP file format" or something similar. 


pgsql-general by date:

Previous
From: S McGraw
Date:
Subject: Re: Importing directly from BCP files
Next
From: Tim Uckun
Date:
Subject: Re: Importing directly from BCP files