databaseuser=globus1
result=`psql << EOF
SELECT u.usename FROM pg_catalog.pg_user u where u.usename='${databaseuser}';
EOF`
usename=`echo $result | awk -F' ' '{print $3}'`
echo "${usename}"
if [ "${usename}" = "(0" ]; then
echo "usename not found"
else
echo "usename=${usename}"
fi
result=`psql << EOF
SELECT u.usename FROM pg_catalog.pg_user u where u.usename='${databaseuser}';
EOF`
usename=`echo $result | awk -F' ' '{print $3}'`
echo "${usename}"
if [ "${usename}" = "(0" ]; then
echo "usename not found"
else
echo "usename=${usename}"
fi