On Sun, Nov 14, 2010 at 1:15 AM, Tom Lane <t...@sss.pgh.pa.us> wrote: > Cleanup at first connection is something we've been avoiding for years, > but maybe it's time to bite the bullet and do that? >
Another alternative is to initialize the unlogged tables when you first access them. If you try to open a table and there are no files attached them go ahead and initialize it by creating an empty table and building any indexes. Hm, I had been assuming recovery would be responsible for cleaning up the tables even if the first access is responsible for rebuilding them. But there's a chance there have been no modifications to them since the last checkpoint. But in that case the data in them is fine. It would be a weird interface if it only cleared them out sometimes based on unpredictable timing though. Avoiding that does require some kind of alternate storage scheme other than the WAL to indicate what needs to be cleared out. .init files are as good a mechanism even if they just mean "unlink this file on startup". -- greg -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers