//Посмотреть сессии
SELECT usename, client_addr, backend_start, pid FROM pg_stat_activity WHERE datname = 'rtneo';
//Убиваем сессии
SELECT pg_terminate_backend(pg_stat_activity.pid) FROM pg_stat_activity WHERE pg_stat_activity.datname = 'rtneo' AND pid <> pg_backend_pid();
DROP DATABASE rtneo;
create database rtneo owner cuba;
Это только из под superuser
sudo -u postgres psql
\c rtneo
CREATE EXTENSION dblink;