Re: Executing SQL commands in script files

Поиск
Список
Период
Сортировка
От Josh Berkus
Тема Re: Executing SQL commands in script files
Дата
Msg-id 200302131953.59989.josh@agliodbs.com
обсуждение исходный текст
Ответ на Executing SQL commands in script files  ("Susan Hoddinott" <susan@perth.dialix.com.au>)
Список 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 по дате отправления:

Предыдущее
От: simran
Дата:
Сообщение: Re: Executing SQL commands in script files
Следующее
От: Michael Weaver
Дата:
Сообщение: Passing arrays