My Googlefu is failing me. Are there any code snippets, either in Python or FORTRAN, that shows how to create binary files to be used by the COPY command in PostgreSQL?
Postgresql – How to generate PostgreSQL COPY bin files
importpostgresql
Related Question
- Thesql to postgresql, migrate files directly ( longblob > pg_largeobject )
- Postgresql – Why doesn’t postgresql COPY command work with files in mapped drives
- Postgresql – How to copy a PostgreSQL database at a filesystem level between servers
- PostgreSQL – Copy Table Functions to Another Database Schema
- Postgresql – Psycopg2 Errors on SQL statement when trying to copy data from CSV file into PostgreSQL database
- PostgreSQL COPY Command – Usage and Examples
- Postgresql – Check the time that PostgreSQL is taking to automatically create existing indexes when you do bulk insert using copy command from Spark
Best Answer
Your best bet really is to create CSV files and then import them with COPY. If you want to, you can then wrap them simply in a COPY ... WITH CSV FROM STDIN statement.
The existing docs on the COPY command should be sufficient. See http://www.postgresql.org/docs/9.1/static/sql-copy.html