Re: Logging SQL queries?

From: Ralph Graulich <maillist(at)shauny(dot)de>
To: PostgreSQL General Mailing List <pgsql-general(at)postgresql(dot)org>
Subject: Re: Logging SQL queries?
Date: 2002-07-18 22:49:25
Message-ID: Pine.LNX.4.21.0207190042140.11568-100000@shauny.shauny.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

just my two cents worth tho. I'd love having some kind of "internal log
facility", which means being able to do the follwing:

a) using log functions in every place where common SQL is allowed, which
counts for
- selects, updates, inserts, deletes (in transaction blocks)
- triggers
- functions

b) setting a log level

c) setting which log levels (and greater) really get logged

For example:

CREATE FUNCTION foobar RETURNS INTEGER AS '
DECLARE
...
BEGIN
...
IF ...
LOG('executing if-branch in foobar for value = ' || someval, 2);
END IF;
...
...
END;
' LANGUAGE 'plpgsql';

So within any application or psql session one can decide what gets logged
by using:

SET LOGLEVEL TO 1;

which means logging all messages with a level of 1 or higher.

Just a proposal for future enhancement probably. Open for any comments,
requests... what do others think about that debugging possibility?

Kind regards
... Ralph ...

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2002-07-18 22:49:30 Re: Bad HTML in Mail List Archives
Previous Message Neil Conway 2002-07-18 22:16:44 Re: Appropriate values for sort_mem and shared_buffers