#!/usr/bin/env bash set -e DEFAULT_USER="postgres" if [ "$(uname)" = "OpenBSD" ]; then DEFAULT_USER="_postgresql" fi cd / username=$1 shift tables="$(printf "'%s'," "${@//\'/\'\'}")" tables="${tables%,}" if [ "$EUID" -eq 0 ]; then sudo -u "$DEFAULT_USER" psql postgres "$DEFAULT_USER" <