updated description of database preparation
This commit is contained in:
@@ -56,12 +56,21 @@ energy-consumption-ingester/
|
||||
4. **Set up PostgreSQL database:**
|
||||
|
||||
```bash
|
||||
# Create database
|
||||
createdb energy_consumption
|
||||
# Connect to Postgres14 host
|
||||
psql -U <POSTGRES_ADMIN> -h <POSTGERS_HOST> -p <POSTGERS_PORT>
|
||||
|
||||
# Create user (optional - run the script)
|
||||
chmod +x scripts/create_db_user.sh
|
||||
./scripts/create_db_user.sh
|
||||
# Create database user
|
||||
CREATE USER <DB_USER> WITH PASSWORD <DB_PASSWORD>;
|
||||
|
||||
# Create database
|
||||
CREATE DATABASE <DB_NAME>;
|
||||
|
||||
# Grant full privileges on database to user
|
||||
GRANT ALL PRIVILEGES ON DATABASE <DB_NAME> TO <DB_USER>;
|
||||
|
||||
# (Optional) verify new user and database creation
|
||||
\q
|
||||
psql -U <DB_USER> -h <POSTGRES_HOST> -p <POSTGERS_PORT>
|
||||
```
|
||||
|
||||
## Configuration
|
||||
|
||||
Reference in New Issue
Block a user