I have some .sql files with thousands of INSERT statements in them and need to run these inserts on my PostgreSQL database in order to add them to a table.
The files are that large that it is impossible to open them and copy the INSERT statements into an editor window and run them there.
You can use the following by navigating to the bin folder of your PostgreSQL install:
You have four choices to supply a password:
- Set the PGPASSWORD environment variable. For details see the manual:
- Use a .pgpass file to store the password. For details see the manual:
- Use "trust authentication" for that specific user: http://www.postgresql.org/docs/current/static/auth-methods.html#AUTH-TRUST
- Since PostgreSQL 9.1 you can also use a connection string: