Обсуждение: logging aql queries only one table or tables of one scheme
Hello
Is it possible to enable query statement logging only for one table (or one scheme)? If I set log_min_duration_statement = 0 everything is logged, the log-files becomes huge.
Maybe there are other possibilities to achieve this target?
Guido Häfliger
____________________________________________________
Dipl. Ing. ETH Guido Häfliger
EDV/GIS-Spezialist
Tel. ++41 41 462 97 60
guido.haefliger@vogelwarte.ch
www.vogelwarte.ch
Schweizerische Vogelwarte | Seerose 1 | CH-6204 Sempach | Schweiz
Station ornithologique suisse | Seerose 1 | CH-6204 Sempach | Suisse
Stazione ornitologica svizzera | Seerose 1 | CH-6204 Sempach | Svizzera
Swiss Ornithological Institute | Seerose 1 | CH-6204 Sempach | Switzerland
Willkommen im neuen Besuchszentrum in Sempach! http://www.vogelwarte.ch/de/besuch/
Bienvenue au nouveau centre de visite à Sempach! http://www.vogelwarte.ch/fr/visite/
On Mon, Nov 19, 2018 at 2:38 AM Häfliger Guido <guido.haefliger@vogelwarte.ch> wrote: > Is it possible to enable query statement logging only for one table (or one scheme)? If I set log_min_duration_statement= 0 everything is logged, the log-files becomes huge. No, that particular setting (like most) doesn't operate at a sub-session level. And since it is super-user only changing it for individual queries is not recommended - though you could create a security definer function to make it doable (never tried it myself). David J.
On 19/11/18 6:13 μ.μ., David G. Johnston wrote: > On Mon, Nov 19, 2018 at 2:38 AM Häfliger Guido > <guido.haefliger@vogelwarte.ch> wrote: >> Is it possible to enable query statement logging only for one table (or one scheme)? If I set log_min_duration_statement= 0 everything is logged, the log-files becomes huge. > No, that particular setting (like most) doesn't operate at a > sub-session level. And since it is super-user only changing it for > individual queries is not recommended - though you could create a > security definer function to make it doable (never tried it myself). pgaudit does the trick, but it takes some reading to get what you need. > > David J. >
Thanks a lot for your hints, I will try to do it with pgaudit, seems to be a useful tool Best regards Guido -----Ursprüngliche Nachricht----- Von: Achilleas Mantzios [mailto:achill@matrix.gatewaynet.com] Gesendet: Montag, 19. November 2018 20:04 An: pgsql-admin@lists.postgresql.org Betreff: Re: logging aql queries only one table or tables of one scheme On 19/11/18 6:13 μ.μ., David G. Johnston wrote: > On Mon, Nov 19, 2018 at 2:38 AM Häfliger Guido > <guido.haefliger@vogelwarte.ch> wrote: >> Is it possible to enable query statement logging only for one table (or one scheme)? If I set log_min_duration_statement= 0 everything is logged, the log-files becomes huge. > No, that particular setting (like most) doesn't operate at a > sub-session level. And since it is super-user only changing it for > individual queries is not recommended - though you could create a > security definer function to make it doable (never tried it myself). pgaudit does the trick, but it takes some reading to get what you need. > > David J. >