Need a way to terminate sessions to drop and recreate a database
I have used the following script to kill connections prior to dropping, creating and loading a database on our in house postgresql instance:
WHERE pg_stat_activity.datname = 'TARGET_DB';
But it requires superuser rights to kill the connections which is something we don't get on Azure.
I would like some programmatic way to do this in Azure.