Re: PoC: pg_dump --filter-data <file> (like Oracle Where Clause on RMAN for specific tables)
Kirk Wolak <wolakk@gmail.com>
From: Kirk Wolak <wolakk@gmail.com>
To: Greg Sabino Mullane <htamfids@gmail.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>, Andrey Borodin <x4mmm@yandex-team.ru>, Nikolay Samokhvalov <nik@postgres.ai>, Pavel Stehule <pavel.stehule@gmail.com>,
Pavlo Golub <Pavlo.Golub@cybertec.at>
Date: 2025-08-16T22:56:12Z
Lists: pgsql-hackers
On Fri, Aug 15, 2025 at 1:25 PM Greg Sabino Mullane <htamfids@gmail.com> wrote: > I've seen this idea pop up over the years, and it's still a good one. > Rather than invent new flags, I think a better approach would be to > convince pg_dump to dump a view, such that table foo has a view fooslice to > limit / filter the output. Then we can simply do: > > pg_dump -t foo=view:fooslice > .. > While we could make the view mapping into a separate filtering file as you > suggest, that's more complexity and also a little more dangerous in an > action-at-a-distance way, so I'd rather have people be very specific in the > mapping on the command line. > Hmmm, first, we are talking a full pg_dump, with some data filtering, I don't think we can avoid adding some kind of switch. While being able to do it on the command line is great for 1 table or 2... it gets unwieldy pretty quickly. Also, changing this inside of a production environment to maintain the slices when different "dumps" have different parameters (our monthly dump goes back 35 days), so for us, having different files with different settings makes the most sense. But this is why I am asking for input/feedback. The feedback is producing ideas... Thanks!