Re: Capturing pgsql ERRORS/NOTICES to file

Поиск
Список
Период
Сортировка
От Josh Berkus
Тема Re: Capturing pgsql ERRORS/NOTICES to file
Дата
Msg-id 200309261133.57357.josh@agliodbs.com
обсуждение исходный текст
Ответ на Capturing pgsql ERRORS/NOTICES to file  ("George Weaver" <georgew1@mts.net>)
Список pgsql-sql
George,

> I am in the process of creating a batch file that will update some
> functions in a database for a remote user similar to:
>
> psql -o output dbname < functionupdate.sql
>
> Is there any way to save any ERROR and NOTICE messages to a file?
>
> The -o option doesn't capture this information.

You have to use command shell redirects.

For example, I commonly do in bash
psql -o output dbname < functionupdate.sql >out.dump
... which sends all the command responses to a file, allowing me to read only 
the errors on the screen.

See a guide to your shell for more creative redirection.

-- 
Josh Berkus
Aglio Database Solutions
San Francisco


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

Предыдущее
От: "George Weaver"
Дата:
Сообщение: Capturing pgsql ERRORS/NOTICES to file
Следующее
От: Wei Weng
Дата:
Сообщение: Re: tsearch2 question