class PgConn::SessionMethods

def exclusive(database, &block)

Run block without any connected users. Existing sessions are terminated
def exclusive(database, &block)
  !database.nil? or raise ArgumentError
  begin
    disable(database)
    terminate(database, nil)
    yield
  ensure
    enable(database)
  end
end