How to import existing *.sql files in PostgreSQL 8.4?

Viewed 188200

I am using PostgreSQL 8.4, and I have some *.sql files to import into a database. How can I do so?

5 Answers

Always preferred using a connection service file (lookup/google 'psql connection service file')

Then simply:

psql service={yourservicename} < {myfile.sql}

Where yourservicename is a section name from the service file.

Related