On 2/19/19 5:02 PM, Julie Nishimura wrote:
Since the command is ALTER DATABASE <your_user_db>, it seems that yes you have to do it for all of them. A simple bash script should knock that out quickly.
If you want new databases to automatically go to tablespace01 then alter template1.
Maybe, depending on the size of your databases, and how much down time you can afford, https://www.postgresql.org/docs/9.6/sql-alterdatabase.html "This command physically moves any tables or indexes in the database's old default tablespace to the new tablespace." For example, our multi-TB databases are so big that moving it all at once is unreasonably slow. And a failure might leave the db is a bad spot. Thus, I'd move one table at a time, a few per outage. Naturally, YMMV.
--
Angular momentum makes the world go 'round. |