From b9ad70d19c0996e9cf844de767d69b19b552b03b Mon Sep 17 00:00:00 2001 From: Slawek Figiel Date: Wed, 26 Jun 2024 14:58:47 +0200 Subject: [PATCH] [#1428] Switch DB before granting privileges --- doc/user/install.rst | 4 ++-- etc/setup-db.sql | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/user/install.rst b/doc/user/install.rst index c1a3f4456..d2301a495 100644 --- a/doc/user/install.rst +++ b/doc/user/install.rst @@ -139,10 +139,10 @@ Then, prepare the database: CREATE DATABASE postgres=# GRANT ALL PRIVILEGES ON DATABASE stork TO stork; GRANT - postgres=# GRANT ALL PRIVILEGES ON SCHEMA public TO stork; - GRANT postgres=# \c stork You are now connected to database "stork" as user "postgres". + postgres=# GRANT ALL PRIVILEGES ON SCHEMA public TO stork; + GRANT stork=# create extension pgcrypto; CREATE EXTENSION diff --git a/etc/setup-db.sql b/etc/setup-db.sql index da53b4468..e4f051b42 100644 --- a/etc/setup-db.sql +++ b/etc/setup-db.sql @@ -1,6 +1,6 @@ CREATE DATABASE stork; CREATE USER stork WITH ENCRYPTED PASSWORD 'stork123'; GRANT ALL PRIVILEGES ON DATABASE stork TO stork; -GRANT ALL PRIVILEGES ON SCHEMA public TO stork; \c stork +GRANT ALL PRIVILEGES ON SCHEMA public TO stork; CREATE EXTENSION pgcrypto;