#!/bin/bash

cat <<CMD | psql
create database $2;
create role $2;
grant $2 to $1;
CMD