#!/bin/bash # Define variables DB_USER="postgres" DB_PASSWORD="password" DB_NAME="mydb" DB_SCHEMA="public" DB_PORT="5432" # Update the system and install PostgreSQL sudo pacman -Syu --noconfirm sudo pacman -S --noconfirm postgresql # Initialize the database cluster sudo -iu postgres initdb --locale $LANG -E UTF8 -D '/var/lib/postgres/data' # Start and enable PostgreSQL service sudo systemctl start postgresql sudo systemctl enable postgresql # Switch to the postgres user to set up the database and user sudo -iu postgres psql <