title: PostgreSQL: pg_dump fails with permission denied
body: <p>Today I have tried to dump my PgSQL database, something I do from time to time without any trouble, but it failed:</p>
  
  <pre><code>borelupo@l5nets02:~$ pg_dump -f spam-20150123.sql -F p -O -C -h x.x.x.x -U borelupo spam
  Password:
  pg_dump: SQL command failed
  pg_dump: Error message from server: ERROR:  permission denied for relation badports
  pg_dump: The command was: LOCK TABLE public.badports IN ACCESS SHARE MODE
  </code></pre>
  
  <p>Now, the user <strong>borelupo</strong> is owner of the table, how can he get <em>permission denied</em> at all?</p>
  
  <pre><code>spam=&gt; \d
           List of relations
  Schema |     Name      | Type  |  Owner
  -------+---------------+-------+----------
  public | badports      | table | borelupo
  </code></pre>
  
  <p>What gives? PostgreSQL is 9.1.14.</p>
  
  <p>Edit: When I connect as admin user (postgres), the dumps works OK. But I'd surely like not needing to login into db server, switch users etc.</p>