Re: Executing SQL commands in script files - Mailing list pgsql-novice

From Josh Berkus
Subject Re: Executing SQL commands in script files
Date
Msg-id 200302131953.59989.josh@agliodbs.com
Whole thread Raw
In response to Executing SQL commands in script files  ("Susan Hoddinott" <susan@perth.dialix.com.au>)
List pgsql-novice
Susan,

> Following reading through all the documentation it is not clear to me how
> to run a script file containing a number of SQL commands.  Presumably I do
> this through the psql interface but how do I tell it to run a script?

In PSQL:

\i filename

From the command line, or from cron:

Postgres_dir/bin/psql -U username database < scriptfile

Easy as cake!

--
Josh Berkus
Aglio Database Solutions
San Francisco

pgsql-novice by date:

Previous
From: simran
Date:
Subject: Re: Executing SQL commands in script files
Next
From: Michael Weaver
Date:
Subject: Passing arrays