Re: Logging question

Поиск
Список
Период
Сортировка
От Michael Fuhr
Тема Re: Logging question
Дата
Msg-id 20050118024944.GA15140@winnie.fuhr.org
обсуждение исходный текст
Ответ на Logging question  (Madison Kelly <linux@alteeve.com>)
Ответы Re: Logging question  (Tony Caduto <tony.caduto@amsoftwaredesign.com>)
Re: Logging question  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
On Mon, Jan 17, 2005 at 09:03:17PM -0500, Madison Kelly wrote:

>   Is there any way I can log and/or display database calls for a
> specific database?

I don't know of a way to enable logging for a specific database,
but you can enable logging for a specific user or session.  For
example, you could cause johndoe's statements to be logged by doing
one of the following:

ALTER USER johndoe SET log_statement TO TRUE;  -- 7.x
ALTER USER johndoe SET log_statement TO 'all'; -- 8.0

All new connections that johndoe makes will now have statement
logging enabled.

To enable logging for a particular session, execute the appropriate
"SET log_statement" statement in that session.  If you have permission
problems then you could wrap that operation in a function defined
as SECURITY DEFINER and create the function as a database superuser.

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

В списке pgsql-general по дате отправления:

Предыдущее
От: Madison Kelly
Дата:
Сообщение: Logging question
Следующее
От: Paul Tillotson
Дата:
Сообщение: Re: Logging question