pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
SV: Implementing pgaudit extension on Microsoft Windows
3+ messages / 2 participants
[nested] [flat]

* SV: Implementing pgaudit extension on Microsoft Windows
@ 2019-02-12 07:57 Niels Jespersen <NJN@dst.dk>
  2019-02-12 09:34 ` SV: Implementing pgaudit extension on Microsoft Windows Niels Jespersen <NJN@dst.dk>
  0 siblings, 1 reply; 3+ messages in thread

From: Niels Jespersen @ 2019-02-12 07:57 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: 'pgsql-general@lists.postgresql.org' <pgsql-general@lists.postgresql.org>

Thanks Tom

alter system set pgaudit.log = 'all'; -- Works, it results in 2019-02-12 08:51:49.109 CET [13560] LOG:  parameter "pgaudit.log" changed to "all" after select pg_reload_conf();
alter system set pgaudit.logx = 'all'; -- Notice spelling error logx: Fails, it results immediately in 2019-02-12 08:53:04.412 CET [12856] ERROR:  unrecognized configuration parameter "pgaudit.logx" 2019-02-12 08:53:04.412 CET [12856] STATEMENT:  alter system set pgaudit.logx = 'all';

pgaudit is loaded, as show by: 

localhost postgres@postgres#show shared_preload_libraries;
 shared_preload_libraries
--------------------------
 pgaudit
(1 row)

localhost postgres@postgres#

pgaudit.dll is locked py postgres.exe, if I try to remove it from the lib folder. 

All looks normal, except no logs from auditing. 

Regards Niels


-----Oprindelig meddelelse-----
Fra: Tom Lane <tgl@sss.pgh.pa.us> 
Sendt: 11. februar 2019 15:44
Til: Niels Jespersen <NJN@dst.dk>
Cc: 'pgsql-general@lists.postgresql.org' <pgsql-general@lists.postgresql.org>
Emne: Re: Implementing pgaudit extension on Microsoft Windows

Niels Jespersen <NJN@dst.dk> writes:
> Copied pgaudit.dll to C:\Program Files\PostgreSQL\11\lib Copied  
> pgaudit.control and pgaudit--1.3.sql to C:\Program 
> Files\PostgreSQL\11\share\extension
> Set shared_preload_libraries = 'pgaudit'
> Restart PostgreSQL
> Run "CREATE EXTENSION pgaudit;"
> alter system set pgaudit.log = 'all';
> select pg_reload_conf();

> Nothing enters the log-file from pgaudit. Creating tables (relations, sorry). Selecting from tables, nothing in the log.

Hm, what you describe above looks right.

> I can see that alter system set pgaudit.logx = 'all';  complains about "unrecognized configuration parameter", so something is known about pgaudit.

No, that means the postmaster *doesn't* have pgaudit loaded.

The fact that CREATE EXTENSION worked implies that you've got the library correctly built, so I think this must boil down to the "shared_preload_libraries" setting not having taken.  You could cross-check that by seeing what "SHOW shared_preload_libraries"
prints.

I wonder if you forgot to remove the comment marker (#) on the shared_preload_libraries line?

			regards, tom lane




^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* SV: Implementing pgaudit extension on Microsoft Windows
  2019-02-12 07:57 SV: Implementing pgaudit extension on Microsoft Windows Niels Jespersen <NJN@dst.dk>
@ 2019-02-12 09:34 ` Niels Jespersen <NJN@dst.dk>
  2019-02-12 14:14   ` Re: SV: Implementing pgaudit extension on Microsoft Windows Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 3+ messages in thread

From: Niels Jespersen @ 2019-02-12 09:34 UTC (permalink / raw)
  To: Pavel Stehule <pavel.stehule@gmail.com>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>

Same result from

pgaudit.log = 'all'

in postgresql.conf and after both select pg_reload_conf(); and after service restart.

No entries in the log from audit.

Regards Niels





Fra: Pavel Stehule <pavel.stehule@gmail.com>
Sendt: 12. februar 2019 09:01
Til: Niels Jespersen <NJN@dst.dk>
Cc: Tom Lane <tgl@sss.pgh.pa.us>; pgsql-general@lists.postgresql.org
Emne: Re: Implementing pgaudit extension on Microsoft Windows



út 12. 2. 2019 v 8:59 odesílatel Pavel Stehule <pavel.stehule@gmail.com<mailto:pavel.stehule@gmail.com>> napsal:


út 12. 2. 2019 v 8:57 odesílatel Niels Jespersen <NJN@dst.dk<mailto:NJN@dst.dk>> napsal:
Thanks Tom

alter system set pgaudit.log = 'all'; -- Works, it results in 2019-02-12 08:51:49.109 CET [13560] LOG:  parameter "pgaudit.log" changed to "all" after select pg_reload_conf();
alter system set pgaudit.logx = 'all'; -- Notice spelling error logx: Fails, it results immediately in 2019-02-12 08:53:04.412 CET [12856] ERROR:  unrecognized configuration parameter "pgaudit.logx" 2019-02-12 08:53:04.412 CET [12856] STATEMENT:  alter system set pgaudit.logx = 'all';

pgaudit is loaded, as show by:

localhost postgres@postgres#show shared_preload_libraries;
 shared_preload_libraries
--------------------------
 pgaudit
(1 row)

localhost postgres@postgres#

pgaudit.dll is locked py postgres.exe, if I try to remove it from the lib folder.

All looks normal, except no logs from auditing.

and it doesn't work too if you use postgresql.conf?

don't forget reload

select pg_reload_conf();



Pavel


Regards Niels


-----Oprindelig meddelelse-----
Fra: Tom Lane <tgl@sss.pgh.pa.us<mailto:tgl@sss.pgh.pa.us>>
Sendt: 11. februar 2019 15:44
Til: Niels Jespersen <NJN@dst.dk<mailto:NJN@dst.dk>>
Cc: 'pgsql-general@lists.postgresql.org<mailto:pgsql-general@lists.postgresql.org>' <pgsql-general@lists.postgresql.org<mailto:pgsql-general@lists.postgresql.org>>
Emne: Re: Implementing pgaudit extension on Microsoft Windows

Niels Jespersen <NJN@dst.dk<mailto:NJN@dst.dk>> writes:
> Copied pgaudit.dll to C:\Program Files\PostgreSQL\11\lib Copied
> pgaudit.control and pgaudit--1.3.sql to C:\Program
> Files\PostgreSQL\11\share\extension
> Set shared_preload_libraries = 'pgaudit'
> Restart PostgreSQL
> Run "CREATE EXTENSION pgaudit;"
> alter system set pgaudit.log = 'all';
> select pg_reload_conf();

> Nothing enters the log-file from pgaudit. Creating tables (relations, sorry). Selecting from tables, nothing in the log.

Hm, what you describe above looks right.

> I can see that alter system set pgaudit.logx = 'all';  complains about "unrecognized configuration parameter", so something is known about pgaudit.

No, that means the postmaster *doesn't* have pgaudit loaded.

The fact that CREATE EXTENSION worked implies that you've got the library correctly built, so I think this must boil down to the "shared_preload_libraries" setting not having taken.  You could cross-check that by seeing what "SHOW shared_preload_libraries"
prints.

I wonder if you forgot to remove the comment marker (#) on the shared_preload_libraries line?

                        regards, tom lane


^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: SV: Implementing pgaudit extension on Microsoft Windows
  2019-02-12 07:57 SV: Implementing pgaudit extension on Microsoft Windows Niels Jespersen <NJN@dst.dk>
  2019-02-12 09:34 ` SV: Implementing pgaudit extension on Microsoft Windows Niels Jespersen <NJN@dst.dk>
@ 2019-02-12 14:14   ` Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 3+ messages in thread

From: Tom Lane @ 2019-02-12 14:14 UTC (permalink / raw)
  To: Niels Jespersen <NJN@dst.dk>; +Cc: 'Pavel Stehule' <pavel.stehule@gmail.com>; pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>

Niels Jespersen <NJN@dst.dk> writes:
> Same result from
> pgaudit.log = 'all'
> in postgresql.conf and after both select pg_reload_conf(); and after service restart.
> No entries in the log from audit.

Hm.  I don't know much about pgaudit, but just from scanning its
documentation, it doesn't seem like there's anything else that
has to be set.

I wonder whether pgaudit actually works on Windows?  It might have
some weird dependency on children being spawned with fork not exec,
for instance.  You probably ought to contact the authors and ask.

			regards, tom lane




^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2019-02-12 14:14 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2019-02-12 07:57 SV: Implementing pgaudit extension on Microsoft Windows Niels Jespersen <NJN@dst.dk>
2019-02-12 09:34 ` Niels Jespersen <NJN@dst.dk>
2019-02-12 14:14   ` Tom Lane <tgl@sss.pgh.pa.us>

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