CREATE DATABASE doesn't work inside a DO $$ ... $$ block (transactional restriction). And psql `:'var'` substitutions resolve client-side, so they can't reach inside a DO block either. Replace both DO blocks with psql-native idioms: - `\gexec` for the conditional CREATE DATABASE - `\if` + `\gset` for the create-or-rotate-password branch on the brain_app role Verified end-to-end on koala postgres18: brain DB created, vector 0.8.1 extension installed, brain_app role login works.
1.6 KiB
1.6 KiB