Re: Sending errors from psql to error file

Поиск
Список
Период
Сортировка
От Oliver Elphick
Тема Re: Sending errors from psql to error file
Дата
Msg-id 1092323361.11184.34.camel@braydb
обсуждение исходный текст
Ответ на Re: Sending errors from psql to error file  (Devin Whalen <devin@synapticvision.com>)
Ответы Re: Sending errors from psql to error file  (Devin Whalen <devin@synapticvision.com>)
Re: Sending errors from psql to error file  (Oliver Elphick <olly@bray-healthcare.com>)
Список pgsql-sql
On Thu, 2004-08-12 at 16:01, Devin Whalen wrote:
> > zcat cli_postDataInserts.sql.gz |
> >    psql -d cli_post -U system --echo-queries -f - >trace.file 2>&1
> 
> Just a few questions about your command.  I tried it with one sql
> statement that I know doesn't work and the error went into the right
> file.  However, I would like to know WHY it works...hope you don't mind
> shedding some light on it :).  Specifically, the - >trace.file 2>&1
> part.  I know...well actually think, that the > is redirecting the ouput to the trace.file.  But what the hell is
2>&1doing??
 
> Also, the - ...it kinda just looks like a stray dash to me....although I know it must be doing something ;).
> Will this put all output?  Or just the errors.

">" redirects standard output
"2>" redirects standard error

Your command did not redirect standard error, so the errors didn't get
to grep

The syntax for -f is "-f filename"; the filename "-" means standard
input.  (Check the man page for psql!)


Oliver



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

Предыдущее
От: Stephan Szabo
Дата:
Сообщение: Re: function expression in FROM may not refer to other relations
Следующее
От: Devin Whalen
Дата:
Сообщение: Re: Sending errors from psql to error file