How to Corrupt Your PostgreSQL Database
cybertec-postgresql.com
cybertec-postgresql.com
select pg_logical_emit_message(false,v,v) from (select repeat(' '::text,1024*1024*1023)) v(v);
This generates and writes a WAL record that cannot be read by PostgreSQL, thus breaking all processes that want to read that record (replication and crash recovery). But, as mentioned before, it doesn't corrupt the data in the databases.