Files
zeekayandHanzo Dev 245de178aa pg_cron is created in the database it runs from
With SQL_DB set to anything but postgres, CREATE EXTENSION pg_cron failed and
aborted the init, so no later script ran.

Co-authored-by: Hanzo Dev <[email protected]>
2026-09-16 18:50:32 -07:00

24 lines
821 B
SQL

-- Hanzo SQL: Enable extensions
-- Using DO blocks so individual extension failures don't abort the init script.
CREATE EXTENSION IF NOT EXISTS vector;
CREATE EXTENSION IF NOT EXISTS postgis;
CREATE EXTENSION IF NOT EXISTS tsm_system_rows;
-- DocumentDB extensions may fail if shared_preload_libraries config differs;
-- wrap in DO block to keep PG running regardless.
DO $$ BEGIN
CREATE EXTENSION IF NOT EXISTS documentdb_core;
EXCEPTION WHEN OTHERS THEN
RAISE WARNING 'documentdb_core extension not loaded: %', SQLERRM;
END $$;
DO $$ BEGIN
CREATE EXTENSION IF NOT EXISTS documentdb;
EXCEPTION WHEN OTHERS THEN
RAISE WARNING 'documentdb extension not loaded: %', SQLERRM;
END $$;
-- pg_cron lives in cron.database_name and refuses any other database.
\connect postgres
CREATE EXTENSION IF NOT EXISTS pg_cron;