On Thu, Jan 29, 2015 at 9:47 AM, Marco Nenciarini <marco.nenciar...@2ndquadrant.it> wrote: > The current implementation of copydir function is incompatible with LSN > based incremental backups. The problem is that new files are created, > but their blocks are still with the old LSN, so they will not be backed > up because they are looking old enough.
I think this is trying to pollute what's supposed to be a pure fs-level operation ("copy a directory") into something that is aware of specific details like the PostgreSQL page format. I really think that nothing in storage/file should know about the page format. If we need a function that copies a file while replacing the LSNs, I think it should be a new function living somewhere else. A bigger problem is that you are proposing to stamp those files with LSNs that are, for lack of a better word, fake. I would expect that this would completely break if checksums are enabled. Also, unlogged relations typically have an LSN of 0; this would change that in some cases, and I don't know whether that's OK. The issues here are similar to those in http://www.postgresql.org/message-id/20150120152819.gc24...@alap3.anarazel.de - basically, I think we need to make CREATE DATABASE and ALTER DATABASE .. SET TABLESPACE fully WAL-logged operations, or this is never going to work right. If we're not going to allow that, we need to disallow hot backups while those operations are in progress. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers