mirror of
https://github.com/hanzoai/sql.git
synced 2026-11-15 19:38:30 +00:00
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]>
24 lines
821 B
SQL
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;
|