I have a pretty basic database. I need to drop a good size users list into the db. I have the dump file, need to convert it to a .pg file and then somehow load this data into it.
The data I need to add are in CSV format.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I assume you already have a .pg file, which I assume is a database dump in the “custom” format.
PostgreSQL can load data in CSV format using the
COPYstatement. So the absolute simplest thing to do is just add your data to the database this way.If you really must edit your dump, and the file is in the “custom” format, there is unfortunately no way to edit the file manually. However, you can use
pg_restoreto create a plain SQL backup from the custom format and edit that instead.pg_restorewith no-dargument will generate an SQL script for insertion.