Re: Creating a new database on a different file system - Mailing list pgsql-general

From Laurenz Albe
Subject Re: Creating a new database on a different file system
Date
Msg-id 7002449259b582723ed7e041a7f0de116b48ad4d.camel@cybertec.at
Whole thread Raw
In response to Re: Creating a new database on a different file system  (Luca Ferrari <fluca1978@gmail.com>)
Responses Re: Creating a new database on a different file system
List pgsql-general
On Mon, 2025-03-17 at 15:51 +0100, Luca Ferrari wrote:
> On Mon, Mar 17, 2025 at 3:49 PM Ian Dauncey <Ian.Dauncey@bankzero.co.za> wrote:
> > We have created a few databases on the file system defined in the postgresql.conf,
> > but now I would like to create another database within the same cluster but on a
> > different file system.
> >
> > Is this possible and if so, how do we go about it.
>
> create a tablespace on the filesystem you want to use, and then create
> the database adding the `WITH TABLESPACE` clause.
> See <https://www.postgresql.org/docs/17/sql-createtablespace.html>

That is an option, but I would recommend to create a new database cluster
on the new file system rather than creating a tablespace.

Yours,
Laurenz Albe



pgsql-general by date:

Previous
From: Sylvain Cuaz
Date:
Subject: Restoring only a subset of schemas
Next
From: Adrian Klaver
Date:
Subject: Re: Restoring only a subset of schemas