It turns out I was using an incompatible version of pangres. After upgrading to pangres version 4.2.1, this error was fixed.