Can I change/su user in the middle of a script?
if [ "$user" == "" ]; then
  echo "Enter the table name";
  read user
fi
gunzip *
chown postgres *
su postgres 
dropdb $user
psql -c "create database $user with encoding 'unicode';" -U dbname template1
psql -d $user -f *.sql
 
     
     
     
     
     
     
    