Re: How to log whole query statement to relation?

Поиск
Список
Период
Сортировка
От A. Kretschmer
Тема Re: How to log whole query statement to relation?
Дата
Msg-id 20070424093527.GI11053@a-kretschmer.de
обсуждение исходный текст
Ответ на How to log whole query statement to relation?  ("David Flegl" <ml_flegl@centrum.cz>)
Ответы Re: How to log whole query statement to relation?
Список pgsql-novice
am  Tue, dem 24.04.2007, um  9:00:54 +0200 mailte David Flegl folgendes:
> Hi to all, I realy need help of you. My problem is $subj. I mean, for
> example. If user run command like: INSERT INTO public.foo (at1,at10)
> VALUES ('val1','val10') I would need to catch this (may be in
> trigger?) and store this textual command to other log table. Later I
> will need to run EXECUTE on this. That's why logging.  I tryied to
> build a trigger, but it's not generally usable, becase some user may
> run INSERT stmt with others specified atributes (some of them have
> default values) and trigger cannot catch this situation.
>
> Or anyone has other possible solution how to solve this problem?
> Generaly: on specified tables I need to know (inside PostgreSQL, not
> seeing log files in system) which command user run. This is because of
> I need to made of very simplified asynchronnous multimaster
> replication (better say synchronization).


I think, you can't do log the sql as text, but you can tools like
'tablelog' to obtain a similar behavior:

http://ads.wars-nicht.de/blog/archives/100-Log-Table-Changes-in-PostgreSQL-with-tablelog.html


Andreas
--
Andreas Kretschmer
Kontakt:  Heynitz: 035242/47150,   D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID:   0x3FFF606C, privat 0x7F4584DA   http://wwwkeys.de.pgp.net

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

Предыдущее
От: "David Flegl"
Дата:
Сообщение: How to log whole query statement to relation?
Следующее
От: David Flegl
Дата:
Сообщение: Re: How to log whole query statement to relation?