To run a script against a PostgreSQL database from Unix / Linux command prompt do the
following:
psql [database name] < [script name]
Otherwise if you are connected to database through psql and want to call an external script
you can use \i for example:
testdb=# \i [script name]
|