SELECT 'CREATE DATABASE hydra' WHERE NOT EXISTS (SELECT * FROM pg_database WHERE datname = 'hydra')\gexec
GRANT ALL PRIVILEGES ON DATABASE hydra TO lasql