Let an app ask for PostgreSQL extensions its user can't make

coreapp.toml's [postgres] extensions = ["vector"]: the installer checks
the Core's PostgreSQL has each one (refusing before anything changes if
not) and makes them in the app's database as the superuser, with CASCADE,
on install and every update. Ones taken off the list are kept, since the
data may use them. Also fixes the check refusing needs with both postgres
and mysql, which never ran.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-12-03 20:28:33 -07:00
co-authored by Claude Opus 5.5
parent a7cd4e325c
commit cf18bef278
9 changed files with 113 additions and 8 deletions
+8
View File
@@ -0,0 +1,8 @@
# The extensions coreapp.toml asks for ([postgres] extensions), made by the
# Core's superuser in the app's database (the app's user can't make
# untrusted ones, like vector). Ones already there are kept, also when the
# list drops them: the app's data may use them.
for extension in {{EXTENSIONS}}; do
docker exec postgresql psql -U postgres -d {{DBNAME}} -v ON_ERROR_STOP=1 -qc "CREATE EXTENSION IF NOT EXISTS \"$extension\" CASCADE"
done
unset extension