Skip to content

Commit a1ac577

Browse files
committed
🔧(docker) fix prosody table creation on startup
Starting with PostreSQL 15, the CREATE privilege on public schema is revoked from all users except the database owner. Adding a connection to the Prosody database at container startup to manually grant all privileges on the `public` schema, ensuring Prosody can create its tables properly.
1 parent cbd41ec commit a1ac577

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

docker/files/docker-entrypoint-initdb.d/init_user_db.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,9 @@ psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-E
66
CREATE DATABASE prosody;
77
GRANT ALL PRIVILEGES ON DATABASE prosody TO prosody;
88
EOSQL
9+
10+
# Connect to the prosody database to grant all privileges on schema public
11+
# Required since PostgreSQL > 15
12+
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "prosody" <<-EOSQL
13+
GRANT ALL ON SCHEMA public TO prosody;
14+
EOSQL

0 commit comments

Comments
 (0)