I can't enable pg_cron in my Postgres 18 instance. Install command:
➜ /usr fastfetch
.',;::::;,'. ramiel@ramiel
.';:cccccccccccc:;,. -------------
.;cccccccccccccccccccccc;. OS: Fedora Linux 43 (Server Edition) x86_64
.:cccccccccccccccccccccccccc:. Kernel: Linux 6.19.7-200.fc43.x86_64
.;ccccccccccccc;.:dddl:.;ccccccc;. Uptime: 6 days, 22 hours, 30 mins
.:ccccccccccccc;OWMKOOXMWd;ccccccc:. Packages: 1343 (rpm)
.:ccccccccccccc;KMMc;cc;xMMc;ccccccc:. Shell: zsh 5.9
,cccccccccccccc;MMM.;cc;;WW:;cccccccc, Terminal: /dev/pts/0
:cccccccccccccc;MMM.;cccccccccccccccc: CPU: Intel(R) Core(TM) i5-10400 (12) @ 4.30 GHz
:ccccccc;oxOOOo;MMM000k.;cccccccccccc: GPU: Intel UHD Graphics 630 @ 1.10 GHz [Integrated]
cccccc;0MMKxdd:;MMMkddc.;cccccccccccc; Memory: 10.15 GiB / 31.16 GiB (33%)
ccccc;XMO';cccc;MMM.;cccccccccccccccc' Swap: 792.00 KiB / 8.00 GiB (0%)
ccccc;MMo;ccccc;MMW.;ccccccccccccccc; Disk (/): 41.11 GiB / 91.11 GiB (45%) - ext4
ccccc;0MNc.ccc.xMMd;ccccccccccccccc; Disk (/home): 141.84 GiB / 374.17 GiB (38%) - ext4
cccccc;dNMWXXXWM0:;cccccccccccccc:, Disk (/mnt/hdd/hdd001): 1.49 TiB / 1.79 TiB (83%) - ext4
cccccccc;.:odl:.;cccccccccccccc:,. Disk (/mnt/hdd/hdd002): 1.48 TiB / 1.79 TiB (83%) - ext4
ccccccccccccccccccccccccccccc:'. Disk (/mnt/hdd/hdd003): 849.49 GiB / 1.79 TiB (46%) - ext4
:ccccccccccccccccccccccc:;,.. Local IP (enp1s0): 10.20.20.101/24
':cccccccccccccccc::;,. Locale: en_US.UTF-8
➜ /usr postgres --version
postgres (PostgreSQL) 18.1
➜ /usr sudo dnf install pg_cron_18
Updating and loading repositories:
Repositories loaded.
Package "pg_cron_18-1.6.7-3PGDG.f43.x86_64" is already installed.
Nothing to do.
After I added shared_preload_libraries = 'pg_cron' to the postgresql.conf and restarted the server, I got this error:
➜ /usr systemctl status postgresql
× postgresql.service - PostgreSQL database server
Loaded: loaded (/usr/lib/systemd/system/postgresql.service; enabled; preset: disabled)
Drop-In: /usr/lib/systemd/system/service.d
└─10-timeout-abort.conf
Active: failed (Result: exit-code) since Sun 2026-03-22 04:10:13 UTC; 15min ago
Duration: 12min 29.323s
Invocation: a2156f43cf634579a085a3228ee28122
Process: 427861 ExecStartPre=/usr/libexec/postgresql-check-db-dir postgresql (code=exited, status=0/SUCCESS)
Process: 427863 ExecStart=/usr/bin/postgres -D ${PGDATA} (code=exited, status=1/FAILURE)
Main PID: 427863 (code=exited, status=1/FAILURE)
Mem peak: 3M
CPU: 17ms
Mar 22 04:10:13 ramiel.pi systemd[1]: Starting postgresql.service - PostgreSQL database server...
Mar 22 04:10:13 ramiel.pi postgres[427863]: 2026-03-22 11:10:13.977 WIB [427863] FATAL: could not access file "pg_cron": No such file or directory
Mar 22 04:10:13 ramiel.pi postgres[427863]: 2026-03-22 11:10:13.977 WIB [427863] LOG: database system is shut down
Mar 22 04:10:13 ramiel.pi systemd[1]: postgresql.service: Main process exited, code=exited, status=1/FAILURE
Mar 22 04:10:13 ramiel.pi systemd[1]: postgresql.service: Failed with result 'exit-code'.
Mar 22 04:10:13 ramiel.pi systemd[1]: Failed to start postgresql.service - PostgreSQL database server.
I installed pgvector and postgis and they are working perfectly. So, I did a little digging:
➜ /usr find . -name vector.so
./pgsql-18/lib/vector.so
./lib64/pgsql/vector.so
➜ /usr find . -name postgis-3.so
./pgsql-18/lib/postgis-3.so
./lib64/pgsql/postgis-3.so
➜ /usr find . -name pg_cron.so
./pgsql-18/lib/pg_cron.so
Maybe pg_cron is not loaded because it is not located in the lib64 directory?
Thanks!
Edit: I have SELinux disabled, maybe it is relevant
I can't enable pg_cron in my Postgres 18 instance. Install command:
After I added
shared_preload_libraries = 'pg_cron'to thepostgresql.confand restarted the server, I got this error:I installed pgvector and postgis and they are working perfectly. So, I did a little digging:
Maybe pg_cron is not loaded because it is not located in the lib64 directory?
Thanks!
Edit: I have SELinux disabled, maybe it is relevant