Postgresql: Move database to new tablespace
ALTER DATABASE name SET TABLESPACE new_tablespace


Excerpt from the docs:


  ... changes the default tablespace of the database. Only the database owner or a superuser can do this; you must also have create privilege for the new tablespace. This command physically moves any tables or indexes in the database's old default tablespace to the new tablespace. Note that tables and indexes in non-default tablespaces are not affected.