There is a way do do it on OS/2 but it requires that you run psql.exe in a
shell from the epm editor. That will allow you to feed input typed in the
editor to stdin of psql and the editor will capture stdout and stderr from
psql.
Setting it up is convoluted at best...
For people who want a simple session log I thought it would be easier to
append -L mylog.log to the psql command line and it makes it easier to
answer questions about someone's SQL adventures.
Lorne
In <200501041512.j04FCCk19930@candle.pha.pa.us>, on 01/04/05
at 10:12 AM, Bruce Momjian <pgman@candle.pha.pa.us> said:
>I thought we had a similar capability to log all psql output but I see we
>do not. I just tried 'psql test | tee /tmp/log' and that didn't display
>anything to my terminal so even on Unix it doesn't work.
>I suppose on Unix people use 'script' but I don't imagine that exists on
>Win32.
>---------------------------------------------------------------------------
>lsunley@mb.sympatico.ca wrote:
>> Here is a patch that allows psql to create a session log
>>
>> NOTE - the patch to the makefile is to keep it from constantly building
>> psql.exe as the target "psql" all by itself is never created as the output
>> executable on OS/2 and Windows is psql.exe.
>>
>> The patch provides for a new command line argument -L logfile-name that is
>> used to turn on session logging with output to the specified file name.
>> The output from the logging is always appended to an existing file.
>>
>> The session log records both the query text and the results from the
>> queries.
>>
>> Lorne Sunley
>>
>> --
>> -----------------------------------------------------------
>> lsunley@mb.sympatico.ca
>> -----------------------------------------------------------
>[ Type application/octet-stream treated as attachment, skipping... ]
>>
>> ---------------------------(end of broadcast)---------------------------
>> TIP 3: if posting/reading through Usenet, please send an appropriate
>> subscribe-nomail command to majordomo@postgresql.org so that your
>> message can get through to the mailing list cleanly
--
-----------------------------------------------------------
lsunley@mb.sympatico.ca
-----------------------------------------------------------