I'm aware of the TOAST, and how it works. I was referring to it ("I think that it should be as large as possible, without hitting the toast. ") I have designed a separate "block" table specifically to avoid storing binary data in the TOAST. So my plan is not going to involve out-of-band storage.
Just to make this very clear: a record in the block table would store a block, not the whole file. My question is to finding the optimal block size (without hitting the toast), and finding the optimal hash algorithm for block de-duplication.
Unless I totally misunderstood how the TOAST works. (?)