citusdata / pg_cron

Run periodic jobs in PostgreSQL
PostgreSQL License
2.89k stars 193 forks source link

ERROR: could not find function "cron_schedule_named" in file "/usr/lib/postgresql/X.X/lib/pg_cron.so" #322

Closed ognyanist closed 6 months ago

ognyanist commented 7 months ago

Hi, I would like to check with you the following error during extension update. It is coming with [v1.3.0] onwards - audit table support and function:

CREATE FUNCTION cron.schedule(job_name name, schedule text, command text)
RETURNS bigint
LANGUAGE C STRICT
AS '$libdir/pg_cron', 'cron_schedule_named'

ERROR:  could not find function "cron_schedule_named" in file "/usr/lib/postgresql/X.X/lib/pg_cron.so"

--I am using :
postgres=# SELECT version();

-------------------------------------------------------------------------------------------------------------------
 PostgreSQL 9.5.24 on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 5.4.0-6ubuntu1~16.04.12) 5.4.0 20160609, 64-bit
(1 row)

I can successfully install and run ALTER EXTENSION pg_cron UPDATE; from 1.0 up to [v1.2.0]. If I run the rest of the pg_cron--1.2--1.3.sql, it runs fine and creates the objects (CREATE TABLE cron.job_run_details ..etc). Just the function is not working the new way. the old way is fine: CREATE FUNCTION cron.schedule(schedule text, command text) RETURNS bigint LANGUAGE C STRICT AS '$libdir/pg_cron', 'cron_schedule';

and audit is working, ex. results of jobs are inserted into cron.job_run_details. I have the same error with versions [v1.3.1]-[v1.6.2].

marcocitus commented 6 months ago

make sure you restart before doing the ALTER EXTENSION to load the latest binaries