On Wed, Jul 21, 2021 at 12:11 PM Mark Dilger <mark.dil...@enterprisedb.com> wrote: > If you were going to support lots of formats, not just tar, you might want > the streamer class for each format to have a callback which sets up the > injector, rather than having CreateBackupStreamer do it directly. Even then, > having now studied CreateBackupStreamer a bit more, the idea seems less > appealing than it did initially. I don't think it makes things any cleaner > when only supporting tar, and maybe not even when supporting multiple > formats, so I'll withdraw the suggestion.
Gotcha. I think if we had a lot of formats I'd probably make a separate function where you passed in the file extension and archive type and it hands you back a parser for the appropriate kind of archive, or something like that. And then maybe a second, similar function where you pass in the injector and archive type and it wraps an archiver of the right type around it and hands that back. But I don't think that's worth doing until we have 2 or 3 formats, which may or may not happen any time in the forseeable future. -- Robert Haas EDB: http://www.enterprisedb.com