diff --git a/pg_search/src/lib.rs b/pg_search/src/lib.rs index be078422a..98394de69 100644 --- a/pg_search/src/lib.rs +++ b/pg_search/src/lib.rs @@ -74,6 +74,10 @@ pub fn MyDatabaseId() -> u32 { #[allow(non_snake_case)] #[pg_guard] pub unsafe extern "C" fn _PG_init() { + if !pg_sys::process_shared_preload_libraries_in_progress { + error!("pg_search must be loaded via shared_preload_libraries. Add 'pg_search' to shared_preload_libraries in postgresql.conf and restart Postgres."); + } + postgres::options::init(); GUCS.init("pg_search");