title: Postgres errors on ARM-based M1 Mac w/ Big Sur
body: <p>Ever since I got a new ARM-based M1 MacBook Pro, I've been experiencing severe and consistent PostgreSQL issues (psql 13.1). Whether I use a Rails server or Foreman, I receive errors in both my browser and terminal like <code>PG::InternalError: ERROR: could not read block 15 in file &quot;base/147456/148555&quot;: Bad address</code> or <code>PG::Error (invalid encoding name: unicode)</code> or <code>Error during failsafe response: PG::UnableToSend: no connection to the server</code>. The strange thing is that I can often refresh the browser repeatedly in order to get things to work (until they inevitably don't again).</p>
  <p>I'm aware of all the configuration challenges related to ARM-based M1 Macs, which is why I've uninstalled and reinstalled everything from Homebrew to Postgres multiple times in numerous ways (with Rosetta, without Rosetta, using <code>arch -x86_64 brew</code> commands, using the Postgres app instead of the Homebrew install). I've encountered a couple other people on random message boards who are experiencing the same issue (also on new Macs) and not having any luck, which is why I'm reluctant to believe that it's a drive corruption issue. (I've also run the Disk Utility FirstAid check multiple times; it says everything's healthy, but I have no idea how reliable that is.)</p>
  <p>I'm using thoughtbot parity to sync up my dev environment database with what's currently in production. When I run <code>development restore production</code>, I get hundreds of lines in my terminal that look like the output below (this is immediately after the download completes but before it goes on to create defaults, process data, sequence sets, etc.). I believe it's at the root of the issue, but I'm not sure what the solution would be:</p>
  <pre><code>pg_restore: dropping TABLE [table name1]
  pg_restore: from TOC entry 442; 1259 15829269 TABLE [table name1] u1oi0d2o8cha8f
  pg_restore: error: could not execute query: ERROR:  table &quot;[table name1]&quot; does not exist
  Command was: DROP TABLE &quot;public&quot;.&quot;[table name1]&quot;;
  pg_restore: dropping TABLE [table name2]
  pg_restore: from TOC entry 277; 1259 16955 TABLE [table name2] u1oi0d2o8cha8f
  pg_restore: error: could not execute query: ERROR:  table &quot;[table name2]&quot; does not exist
  Command was: DROP TABLE &quot;public&quot;.&quot;[table name2]&quot;;
  pg_restore: dropping TABLE [table name3]
  pg_restore: from TOC entry 463; 1259 15830702 TABLE [table name3] u1oi0d2o8cha8f
  pg_restore: error: could not execute query: ERROR:  table &quot;[table name3]&quot; does not exist
  Command was: DROP TABLE &quot;public&quot;.&quot;[table name3]&quot;;
  pg_restore: dropping TABLE [table name4]
  pg_restore: from TOC entry 445; 1259 15830421 TABLE [table name4] u1oi0d2o8cha8f
  pg_restore: error: could not execute query: ERROR:  table &quot;[table name4]&quot; does not exist
  Command was: DROP TABLE &quot;public&quot;.&quot;[table name4]&quot;;
  </code></pre>
  <p>Has anyone else experienced this? Any solution ideas would be much appreciated. Thanks!</p>
  <p>EDIT: I was able to reproduce the same issue on an older MacBook Pro (also running Big Sur), so it seems unrelated to M1 but potentially related to Big Sur.</p>