How to load a SQL file info Postgresql


The SQL files you might download when downloading sample databases from the pgfoundry for example seems to be made for command prompt usage - therefore it might give you some trouble when trying to use them from the pgAdmin interface.

However it's not all that hard:

psql dbname username < filename.sql

is the syntax. So to load the pagila-data file I used:

psql pagila postgres < y:\pagila-data.sql

Be sure to start the command prompt by going through the Postgres menu in the Start menu - then the path's will be set ok for you.