Re: newbie question: reading sql commands from script

Поиск
Список
Период
Сортировка
От Brent Wood
Тема Re: newbie question: reading sql commands from script
Дата
Msg-id 20051026103326.L51409@storm-user.niwa.co.nz
обсуждение исходный текст
Ответ на newbie question: reading sql commands from script files  ("basel novo" <baselnovo@hotmail.com>)
Ответы Re: newbie question: reading sql commands from script  ("basel novo" <baselnovo@hotmail.com>)
Список pgsql-general

On Tue, 25 Oct 2005, basel novo wrote:

> What is the equivalent of the mysql 'source' command for reading sql
> commands from ascii script files?
>

I have not used mysql, so am not familiar with the source command, but to
have postgres run a set of sql statements/queries from a file you can:

psql <DB> -f "filename"



also, to run a single command from a script (or commandline)

psql <DB> -c "<sql command>"



Cheers,

  Brent Wood

В списке pgsql-general по дате отправления:

Предыдущее
От: "Cosmopo"
Дата:
Сообщение: Looking for a command to list schemas
Следующее
От: Rodrigo Gonzalez
Дата:
Сообщение: Re: querying PostgreSQL version?