def __virtual__():
    if all((salt.utils.which('psql'), HAS_CSV)):
        return True
    return (False, 'The postgres execution module failed to load: '
        'either the psql or initdb binary are not in the path or '
        'the csv library is not available')
Only load this module if the psql bin exists
dataset/ETHPy150Open saltstack/salt/salt/modules/postgres.py/__virtual__