It's turning out to be difficult to store the data for my custom index access method in the main fork. Breaking up the data into pages with page headers means a lot of extra work, a big performance hit, and disk space management headaches. It's just not a good fit for my particular file format.
It would be much better to store the index in a set of external data files. This seems possible so long as I put the files under the database's directory and name things properly.
But here's the one thing I haven't figured out: how to delete the files when the index, table, or database gets dropped. The IndexAmRoutine does not have an "amdrop" hook that gets called when the index gets dropped.
Is there a hook I can use to clean these files up? More generally, can I get away with using my own data files without causing a problem?