Re: How to capture an interactive psql session in a log file?

From: Erik Jones <ejones(at)engineyard(dot)com>
To: Gordon Shannon <gordo169(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: How to capture an interactive psql session in a log file?
Date: 2009-04-03 16:52:38
Message-ID: 3FCD8AE5-794A-4C4C-BF79-0DC4A39D5955@engineyard.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


On Apr 2, 2009, at 11:07 PM, Gordon Shannon wrote:

>
> That does the trick, awesome!
>
> I do think it would be great if psql had a "stderr" capture in
> addition to
> stdout.

While the recommendations to use script are perfect for the use case
of capturing everything, including input, I think it's worth
mentioning that there was some discussion not too long ago to give
psql better IO redirection capabilities. The suggestion I like was
something along the lines of

pagila# \o > stdout.txt 2> stderr.txt

as the meaning of that should be immediately obvious to most *nix
users and would also allow

pagila# \o > allout.txt 2>&

and this would default to stdout for backwards compatibility (and
simplicity)

pagila# \o stdout.txt

Erik Jones, Database Administrator
Engine Yard
Support, Scalability, Reliability
866.518.9273 x 260
Location: US/Pacific
IRC: mage2k

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2009-04-03 17:25:05 Re: slow select in big table
Previous Message Sam Mason 2009-04-03 16:28:47 Re: slow select in big table