Schema for pg_cron when initializing the extension

1.1k Views Asked by At

I'm trying to initialize the pg_cron extension in a dedicated schema named 'cron'. I usually create the schema before creating the extension but something goes wrong in this case:

db_dev# CREATE SCHEMA cron;
CREATE SCHEMA

db_dev# CREATE EXTENSION pg_cron WITH SCHEMA cron;
ERROR:  schema "cron" already exists

db_dev# DROP SCHEMA cron;
DROP SCHEMA

db_dev# CREATE EXTENSION pg_cron WITH SCHEMA cron;
ERROR:  schema "cron" does not exist

db_dev# SHOW server_version;
         server_version         
════════════════════════════════
 13.1 (Debian 13.1-1.pgdg100+1)
(1 row)

Anything that I might have missed?

1

There are 1 best solutions below

0
On

Got it. pg_cron will create the cron schema itself. There is no need to create it beforehand.