Fixup bgworker template for 0.5.0
use pgx::bgworkers::*;
+use pgx::datum::{{FromDatum, IntoDatum}};
+use pgx::log;
use pgx::prelude::*;
use std::time::Duration;
-pg_module_magic!();
+pgx::pg_module_magic!();
/*
In order to use this bgworker with pgx, you'll need to edit the proper `postgresql.conf` file in
@@ -33,7 +35,7 @@ pub extern "C" fn _PG_init() {{
#[pg_guard]
#[no_mangle]
pub extern "C" fn background_worker_main(arg: pg_sys::Datum) {{
- let arg = unsafe {{ i32::from_datum(arg, false, pg_sys::INT4OID) }};
+ let arg = unsafe {{ i32::from_datum(arg, false) }};
// these are the signals we want to receive. If we don't attach the SIGTERM handler, then
// we'll never be able to exit via an external notification
