Re: send psql output to file and setting pager=more

Поиск
Список
Период
Сортировка
От kmh496
Тема Re: send psql output to file and setting pager=more
Дата
Msg-id 1148109665.25472.4.camel@var.sirfsup.com
обсуждение исходный текст
Ответ на send psql output to file and setting pager=more  (kmh496 <kmh496@kornet.net>)
Ответы Re: send psql output to file and setting pager=more  ("Andrej Ricnik-Bay" <andrej.groups@gmail.com>)
Список pgsql-novice
> > is it possible in psql to ......
> > (1) i want it to stop after a screen of information.
> > i.e. like mysql's "[mysqld] pager=more .." my.cnf directive.
> >
> Under Linux you can quite easily just run the command
> non-interactively and actually paginate via less or more;
>
> Alternatively, under psql (man psql for details :P) you can
> use \pset pager less.
I put export PAGER=more
into my .bashrc and
executed the command you stated, as well as
\pset pager always
\pset pager more
but they don't stop after a page of input, so they seem to say they are
doing the correct thing but really aren't.

>
> > (2) also, i want to have the results show up on the screen and be
tee-ed
> > to a file.  Oracle can do this, i don't remember if it's "set server
> > output on" or something like that?

I learned the postgres equivalent is
\o filename
but this only directs STDOUT not STDERR
but, i want to capture the error messages into a file so I can then edit
that side by side with the other script which is generating the
messages.  Is it possible for \o to also capture output from both STDERR
and STDOUT?







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

Предыдущее
От: "Andrej Ricnik-Bay"
Дата:
Сообщение: Re: send psql output to file and setting pager=more
Следующее
От: "Andrej Ricnik-Bay"
Дата:
Сообщение: Re: send psql output to file and setting pager=more