powa-team / pg_qualstats

A PostgreSQL extension for collecting statistics about predicates, helping find what indices are missing
Other
273 stars 26 forks source link

Can't CREATE EXTENSION #1

Closed brmzkw closed 9 years ago

brmzkw commented 9 years ago

Hi,

# CREATE EXTENSION pg_qualstats;
FATAL:  cannot create PGC_POSTMASTER variables after startup
server closed the connection unexpectedly
        This probably means the server terminated abnormally
        before or while processing the request.
The connection to the server was lost. Attempting reset: Succeeded.

I don't really understand what's happening here. What should I do to load the extension? (note that I restarted postgresql and pg_qualstats is in shared_preload_libraries in postgresql.conf)

rdunklau commented 9 years ago

Hi,

Are you sure it is in the shared_preload_libraries ? Could you check it with "SHOW shared_preload_libraries" before issuing the CREATE EXTENSION statement ?

brmzkw commented 9 years ago

Oops, indeed, it's not

# SHOW shared_preload_libraries;
 shared_preload_libraries
--------------------------
 pg_stat_statements
(1 row)

Any idea why?

$ grep shared_preload_libraries /etc/postgresql/9.4/main/postgresql.conf
shared_preload_libraries='pg_stat_statements,powa,pg_stat_kcache,pg_qualstats'
rdunklau commented 9 years ago

Are you sure you restarted the server, instead of merely reloading the configuration ? Are you also sure you are modifying the right configuration file ?

Is the shared_preload_libraries overloaded elsewhere in the config file, or in another one included from the main one ?

You can check what config file is being used with SHOW config_file

brmzkw commented 9 years ago

Thanks a lot for your help. I feel stupid :p

I didn't find any override in postgreslq.conf, but it includes include_dir '/etc/postgresql/9.4/main/conf.d' which overrides shared_preload_libraries in a custom configuration file.

Again, thanks a lot for your help :)

rjuju commented 9 years ago

Also the commit 02df9bd84b2f8e178557fc10f6939dbfaed4b01f will now display an error message if the extension is created and not in the shared_preload_libraries instead of closing the connection.