postgrespro/pg_wait_sampling

ERROR: pg_wait_sampling shared memory wasn't initialized yet

Opened this issue · 1 comments

postgres=# select * from pg_wait_sampling_profile;
ERROR: pg_wait_sampling shared memory wasn't initialized yet

You get this error, if you have not set the "shared_preload_libraries". To overcome the error, you need to set the "shared_preload_libraries" in postgresql.conf

shared_preload_libraries = '$libdir/pg_wait_sampling.so'

And restart the server.

Now you can overcome the error and see pg_wait_sampling is running...

postgres=# show shared_preload_libraries ;

shared_preload_libraries

$libdir/pg_wait_sampling.so
(1 row)

postgres=# select * from pg_wait_sampling_profile;
pid | event_type | event | count
-------+------------+-------+-------
50995 | | | 2452
50993 | | | 124
50977 | | | 4687
50978 | | | 4687
50976 | | | 4687
50980 | | | 4688
50975 | | | 4687
(7 rows)

However, the "shared_preload_libraries" information is missing the README documentation which is mandatory.

Regards
Raghav

Thanks for reporting. Fixed in 34e9e47.