Is it possible to exclude a database from WAL and basebackup? I'm planning to add a GIS database to an existing PostgreSQL 12 cluster with multiple databases, streaming (hot standby) replication and WAL archiving.
Once created the new database will never be changed, and is easily recreated from the source data. However it would be very large (100s of GB).
The server is currently backed-up using wal-e (periodic base backups plus wal archiving) and has to use physical replication due to use of large objects.
Is there any way to exclude the new database from this process, so that the backups are not significantly slowed and inflated by the new data? It would still need to work for a replication though, making it an even more complex problem.
Is this something that can be done perhaps with tablespaces, which would then be manually copied for initial replications instead of using pg_basebackup?
No, there is no way to do that.
I would recommend that you create a second PostgreSQL cluster and put the database there. That does not incur a big overhead as far as system resources are concerned, and it will solve your problem.