diff --git a/migrations/db/migrations/20250402093753_grant_subscription_to_postgres_16_and_above.sql b/migrations/db/migrations/20250402093753_grant_subscription_to_postgres_16_and_above.sql new file mode 100644 index 000000000..9e9d881ae --- /dev/null +++ b/migrations/db/migrations/20250402093753_grant_subscription_to_postgres_16_and_above.sql @@ -0,0 +1,13 @@ +-- migrate:up +DO $$ +DECLARE + major_version INT; +BEGIN + SELECT current_setting('server_version_num')::INT / 10000 INTO major_version; + + IF major_version >= 16 THEN + GRANT pg_create_subscription TO postgres; + END IF; +END $$; + +-- migrate:down