On Wed, Feb 22, 2017 at 9:23 PM, Bernd Helmle <maili...@oopsware.de> wrote: > The comment in the code says explicitely to add the base directory to > the end of the list, not sure if that is out of a certain reason. > > I'd say this is an oversight in the implementation. I'm currently > working on a tool using the streaming protocol directly and i've > understood it exactly the way, that the default tablespace is the first > one in the stream. > > So +1 for the patch.
Commit 507069de has switched the main directory from the beginning to the end of the list, and the thread about this commit is here: https://www.postgresql.org/message-id/AANLkTikgmZRkBuQ%2B_hcwPBv7Cd7xW48Ev%3DUBHA-k4v0W%40mail.gmail.com + /* Add a node for the base directory at the beginning. This way, the + * backup_label file is always the first file to be sent. */ ti = palloc0(sizeof(tablespaceinfo)); ti->size = opt->progress ? sendDir(".", 1, true, tablespaces, true) : -1; - tablespaces = lappend(tablespaces, ti); + tablespaces = lcons(ti, tablespaces); So, the main directory is located at the end on purpose. When using --wal-method=fetch the WAL segments are part of the main tarball, so if you send the main tarball first you would need to generate a second tarball with the WAL segments that have been generated between the moment the main tarball has finished until the end of the last tablespace taken if you want to have a consistent backup. Your patch would work with the stream mode though. -- Michael -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers