psql -U $ADMIN_USER -W $ADMIN_PASS -h $DB_HOST -d $ADMIN_DATABASE << EOF 2>/dev/null export PGPASSWORD=$ADMIN_PASS psql -U $ADMIN_USER -h $DB_HOST -d $ADMIN_DB << EOF CREATE USER ${DEST_USER} WITH PASSWORD '${DEST_PASS}'; CREATE DATABASE $DEST_DATABASE; GRANT ALL PRIVILEGES ON DATABASE $DEST_DATABASE TO ${DEST_USER}; ALTER SCHEMA public OWNER to ${DEST_USER}; alter database $DEST_DATABASE set timezone='PRC'; EOF
psql -U $ADMIN_USER -W $ADMIN_PASS -h $DB_HOST -d $ADMIN_DATABASE << EOF 2>/dev/null export PGPASSWORD=$ADMIN_PASS psql -U $ADMIN_USER -h $DB_HOST -d $ADMIN_DB << EOF CREATE USER ${DEST_USER} WITH PASSWORD '${DEST_PASS}'; CREATE DATABASE $DEST_DATABASE; GRANT ALL PRIVILEGES ON DATABASE $DEST_DATABASE TO ${DEST_USER}; ALTER SCHEMA public OWNER to ${DEST_USER}; alter database $DEST_DATABASE set timezone='PRC'; EOF