Issue
You would like to use unlogged tables on Heroku Postgres.
Resolution
Creating unlogged tables on Heroku Postgres (CREATE UNLOGGED TABLE
) is heavily advised against. Unlogged tables are not crash safe, and will be truncated in the event of a crash or otherwise unclean shutdown, losing all data in the unlogged table in the process.
Additionally, as they are not written to the write-ahead log, they are not covered by Continuous Protection (ref: https://devcenter.heroku.com/articles/heroku-postgres-data-safety-and-continuous-protection).
Finally, as a consequence of not being written to the write-ahead log, unlogged tables are not replicated to followers or high-availabiltiy standbies.
This makes data recovery in unlogged tables impossible in the cases of maintenance operations, as well the aforementioned crashes and unclean shutdowns.