title: Revoke connect from superuser
body: <p>Is there any way to revoke connect (or preferably all) privileges on database from role that is defined as superuser on the server? On dev server we've got several databases - one of them is shared, but the rest should be owned only by one developer without connect permission for others. Currently all developers are superusers with login option.</p>
  
  <pre><code>CREATE ROLE dev_name LOGIN
    ENCRYPTED PASSWORD '...'
    SUPERUSER INHERIT CREATEDB CREATEROLE REPLICATION;
  </code></pre>
  
  <p>I've tried to do this on many ways:</p>
  
  <pre><code>REVOKE CONNECT ON DATABASE test_db FROM dev_name;
  revoke select on all tables in schema public from dev_name;
  </code></pre>
  
  <p>and then as I checked with:</p>
  
  <pre><code>SELECT * FROM has_database_privilege('dev_name', 'test_db', 'connect');
  </code></pre>
  
  <p>still returned true.</p>
  
  <p>I've tried with workaround and changed connection limit to another value, but still superusers could connect even when I first logged in:</p>
  
  <pre><code> CONNECTION LIMIT = 1;
  </code></pre>
  
  <p>So, maybe is there chance to do this without messing with pg_hba or dropping superuser status for other developers?</p>