Thread: psql session log

psql session log

From
lsunley@mb.sympatico.ca
Date:
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
-----------------------------------------------------------

Attachment

Re: psql session log

From
Peter Eisentraut
Date:
lsunley@mb.sympatico.ca wrote:
> 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.

If this were a problem on Windows, we'd have more problems all over the
place, not only in psql's makefile.  On Cygwin, I know there is no
problem, because of the peculiar way that the system calls map the file
names.  Not sure what native Windows does.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/

Re: psql session log

From
lsunley@mb.sympatico.ca
Date:
It does happen all over the place...

I have equivalent $(X) patches to all the makefiles in src/bin and below

Lorne

In <200501032247.52189.peter_e@gmx.net>, on 01/03/05
   at 10:47 PM, Peter Eisentraut <peter_e@gmx.net> said:

>lsunley@mb.sympatico.ca wrote:
>> 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.

>If this were a problem on Windows, we'd have more problems all over the
>place, not only in psql's makefile.  On Cygwin, I know there is no
>problem, because of the peculiar way that the system calls map the file
>names.  Not sure what native Windows does.



--
-----------------------------------------------------------
lsunley@mb.sympatico.ca
-----------------------------------------------------------


Re: psql session log

From
Bruce Momjian
Date:
Peter Eisentraut wrote:
> lsunley@mb.sympatico.ca wrote:
> > 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.
>
> If this were a problem on Windows, we'd have more problems all over the
> place, not only in psql's makefile.  On Cygwin, I know there is no
> problem, because of the peculiar way that the system calls map the file
> names.  Not sure what native Windows does.

I tested this on MinGW and didn't have the rebuild problem either.
gmake seems to know the .exe is implied.  I wonder if this is an OS/2
gmake bug.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Re: psql session log

From
lsunley@mb.sympatico.ca
Date:
In <200501041449.j04Enjj00851@candle.pha.pa.us>, on 01/04/05
   at 09:49 AM, Bruce Momjian <pgman@candle.pha.pa.us> said:

>Peter Eisentraut wrote:
>> lsunley@mb.sympatico.ca wrote:
>> > 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.
>>
>> If this were a problem on Windows, we'd have more problems all over the
>> place, not only in psql's makefile.  On Cygwin, I know there is no
>> problem, because of the peculiar way that the system calls map the file
>> names.  Not sure what native Windows does.

>I tested this on MinGW and didn't have the rebuild problem either.  gmake
>seems to know the .exe is implied.  I wonder if this is an OS/2 gmake
>bug.

Looks like it could be...

I even added an explicit .SUFFIXES: .exe and it will still build the exe
file when it is present from a make just done.

what a PITA


--
-----------------------------------------------------------
lsunley@mb.sympatico.ca
-----------------------------------------------------------