pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedlogging a psql script
5+ messages / 5 participants
[nested] [flat]
* logging a psql script
@ 2001-02-21 21:51 Ken Kline <ken@oldbs.com>
0 siblings, 4 replies; 5+ messages in thread
From: Ken Kline @ 2001-02-21 21:51 UTC (permalink / raw)
To: pgsql-sql
Hello,
I would like my psql script to log everything that it does.
I set the following
\set ECHO all
\o foo.txt
\qecho
some sql, some ddl, etc...
\o
But foo.txt only contains
DROP
DROP
DROP
CREATE
CREATE
CREATE
I want it to contain everything that I see on the screen, what am I
missing?
Thanks
Ken
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: logging a psql script
@ 2001-02-21 22:06 Jeff Duffy <jduffy@greatbridge.com>
parent: Ken Kline <ken@oldbs.com>
3 siblings, 0 replies; 5+ messages in thread
From: Jeff Duffy @ 2001-02-21 22:06 UTC (permalink / raw)
To: Ken Kline <ken@oldbs.com>; +Cc: pgsql-sql
On Wed, 21 Feb 2001, Ken Kline wrote:
> Hello,
> I would like my psql script to log everything that it does.
> I set the following
>
> \set ECHO all
> \o foo.txt
> \qecho
>
> some sql, some ddl, etc...
>
> \o
>
>
> But foo.txt only contains
>
> DROP
> DROP
> DROP
> CREATE
> CREATE
> CREATE
>
On UNIX/UNIX-like machines, use the script(1) command (man script for
details).
Jeff
--
Errors have occurred.
We won't tell you where or why.
Lazy programmers.
-- Hacking haiku
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: logging a psql script
@ 2001-02-21 22:36 Frank Joerdens <frank@joerdens.de>
parent: Ken Kline <ken@oldbs.com>
3 siblings, 0 replies; 5+ messages in thread
From: Frank Joerdens @ 2001-02-21 22:36 UTC (permalink / raw)
To: Ken Kline <ken@oldbs.com>; +Cc: pgsql-sql
On Wed, Feb 21, 2001 at 04:51:00PM -0500, Ken Kline wrote:
> Hello,
> I would like my psql script to log everything that it does.
> I set the following
>
> \set ECHO all
> \o foo.txt
> \qecho
>
> some sql, some ddl, etc...
>
> \o
>
>
> But foo.txt only contains
>
> DROP
> DROP
> DROP
> CREATE
> CREATE
> CREATE
>
> I want it to contain everything that I see on the screen, what am I
> missing?
Dunno how you do it via \o; what I do is run the postmaster with the
-d 2 option and then log everything to syslogd. This will log every query
in detail. It's very convenient while you're developing and testing,
especially if you run a separate window with
tail -f /wherever/you/write/your/postgres.log
Regards, Frank
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: logging a psql script
@ 2001-02-22 06:58 Oliver Elphick <olly@lfix.co.uk>
parent: Ken Kline <ken@oldbs.com>
3 siblings, 0 replies; 5+ messages in thread
From: Oliver Elphick @ 2001-02-22 06:58 UTC (permalink / raw)
To: Ken Kline <ken@oldbs.com>; +Cc: pgsql-sql
Ken Kline wrote:
>Hello,
> I would like my psql script to log everything that it does.
psql -e
--
Oliver Elphick Oliver.Elphick@lfix.co.uk
Isle of Wight http://www.lfix.co.uk/oliver
PGP: 1024R/32B8FAA1: 97 EA 1D 47 72 3F 28 47 6B 7E 39 CC 56 E4 C1 47
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839 932A 614D 4C34 3E1D 0C1C
========================================
"The LORD bless thee, and keep thee; The LORD make his
face shine upon thee, and be gracious unto thee; The
LORD lift up his countenance upon thee, and give thee
peace." Numbers 6:24-26
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: logging a psql script
@ 2001-02-22 09:12 Christopher Sawtell <csawtell@xtra.co.nz>
parent: Ken Kline <ken@oldbs.com>
3 siblings, 0 replies; 5+ messages in thread
From: Christopher Sawtell @ 2001-02-22 09:12 UTC (permalink / raw)
To: Ken Kline <ken@oldbs.com>; pgsql-sql
On Thu, 22 Feb 2001 10:51, Ken Kline wrote:
> Hello,
> I would like my psql script to log everything that it does.
Issue the command "script" before you start psql.
It will record everything you see on you screen provided it is not piped
into another program such as "more" or "less".
man script
for the details.
--
Sincerely etc.,
NAME Christopher Sawtell
CELL PHONE 021 257 4451
ICQ UIN 45863470
EMAIL csawtell @ xtra . co . nz
CNOTES ftp://ftp.funet.fi/pub/languages/C/tutorials/sawtell_C.tar.gz
-->> Please refrain from using HTML or WORD attachments in e-mails to me
<<--
^ permalink raw reply [nested|flat] 5+ messages in thread
end of thread, other threads:[~2001-02-22 09:12 UTC | newest]
Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-02-21 21:51 logging a psql script Ken Kline <ken@oldbs.com>
2001-02-21 22:06 ` Jeff Duffy <jduffy@greatbridge.com>
2001-02-21 22:36 ` Frank Joerdens <frank@joerdens.de>
2001-02-22 06:58 ` Oliver Elphick <olly@lfix.co.uk>
2001-02-22 09:12 ` Christopher Sawtell <csawtell@xtra.co.nz>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox