public inbox for [email protected]  
help / color / mirror / Atom feed
Re: Creating a new database on a different file system
4+ messages / 2 participants
[nested] [flat]

* Re: Creating a new database on a different file system
@ 2025-03-17 15:18  Laurenz Albe <[email protected]>
  0 siblings, 1 reply; 4+ messages in thread

From: Laurenz Albe @ 2025-03-17 15:18 UTC (permalink / raw)
  To: Luca Ferrari <[email protected]>; Ian Dauncey <[email protected]>; +Cc: 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 <[email protected]> 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






^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Creating a new database on a different file system
@ 2025-03-17 18:33  Ron Johnson <[email protected]>
  parent: Laurenz Albe <[email protected]>
  0 siblings, 1 reply; 4+ messages in thread

From: Ron Johnson @ 2025-03-17 18:33 UTC (permalink / raw)
  To: pgsql-general

On Mon, Mar 17, 2025 at 11:18 AM Laurenz Albe <[email protected]>
wrote:

> On Mon, 2025-03-17 at 15:51 +0100, Luca Ferrari wrote:
> > On Mon, Mar 17, 2025 at 3:49 PM Ian Dauncey <[email protected]>
> 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.
>

That of course requires using another port, which can be tricky in a
company that by default closes all firewall ports at the network switch
level, and where you must enumerate every server/subnet ("Rejected. Subnet
range too broad!") that needs access to the new port, it takes time for
requests for new port openings to be approved ("Rejected. We don't
recognize 5433!") and then implemented.

Much easier to use a tablespace.

-- 
Death to <Redacted>, and butter sauce.
Don't boil me, I'm still alive.
<Redacted> lobster!


^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Creating a new database on a different file system
@ 2025-03-17 20:30  Laurenz Albe <[email protected]>
  parent: Ron Johnson <[email protected]>
  0 siblings, 1 reply; 4+ messages in thread

From: Laurenz Albe @ 2025-03-17 20:30 UTC (permalink / raw)
  To: Ron Johnson <[email protected]>; pgsql-general

On Mon, 2025-03-17 at 14:33 -0400, Ron Johnson wrote:
> On Mon, Mar 17, 2025 at 11:18 AM Laurenz Albe <[email protected]> wrote:
> > On Mon, 2025-03-17 at 15:51 +0100, Luca Ferrari wrote:
> > > On Mon, Mar 17, 2025 at 3:49 PM Ian Dauncey <[email protected]> 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.
> 
> That of course requires using another port, which can be tricky in a company that by
> default closes all firewall ports at the network switch level, and where you must
> enumerate every server/subnet ("Rejected. Subnet range too broad!") that needs access
> to the new port, it takes time for requests for new port openings to be approved
> ("Rejected. We don't recognize 5433!") and then implemented.
> 
> Much easier to use a tablespace.

*shrug* Sure, there are entities that think that security and professionalism can be
measured in how difficult you are making everybody's life.  If rules and regulations
are in the way of choosing the best solution, you have to go for the second best one.

Yours,
Laurenz Albe






^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Creating a new database on a different file system
@ 2025-03-17 20:50  Ron Johnson <[email protected]>
  parent: Laurenz Albe <[email protected]>
  0 siblings, 0 replies; 4+ messages in thread

From: Ron Johnson @ 2025-03-17 20:50 UTC (permalink / raw)
  To: pgsql-general

On Mon, Mar 17, 2025 at 4:30 PM Laurenz Albe <[email protected]>
wrote:

> On Mon, 2025-03-17 at 14:33 -0400, Ron Johnson wrote:
> > On Mon, Mar 17, 2025 at 11:18 AM Laurenz Albe <[email protected]>
> wrote:
> > > On Mon, 2025-03-17 at 15:51 +0100, Luca Ferrari wrote:
> > > > On Mon, Mar 17, 2025 at 3:49 PM Ian Dauncey <
> [email protected]> 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.
> >
> > That of course requires using another port, which can be tricky in a
> company that by
> > default closes all firewall ports at the network switch level, and where
> you must
> > enumerate every server/subnet ("Rejected. Subnet range too broad!") that
> needs access
> > to the new port, it takes time for requests for new port openings to be
> approved
> > ("Rejected. We don't recognize 5433!") and then implemented.
> >
> > Much easier to use a tablespace.
>
> *shrug* Sure, there are entities that think that security and
> professionalism can be
> measured in how difficult you are making everybody's life.  If rules and
> regulations
> are in the way of choosing the best solution, you have to go for the
> second best one.
>

Things are what they are.

A listener (like what SQL Server uses) on port 5432 that looks at a
connection, determines which instance it's asking for, and then redirects
the connection to it. would be useful.

How?  By enabling multiple instances all externally viewable on 5432, one
can run PgBackRest individually for each database instead of for
*every* database.
Role management would become more complicated, but *how much* more
complicated is site-dependent.

-- 
Death to <Redacted>, and butter sauce.
Don't boil me, I'm still alive.
<Redacted> lobster!


^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2025-03-17 20:50 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2025-03-17 15:18 Re: Creating a new database on a different file system Laurenz Albe <[email protected]>
2025-03-17 18:33 ` Ron Johnson <[email protected]>
2025-03-17 20:30   ` Laurenz Albe <[email protected]>
2025-03-17 20:50     ` Ron Johnson <[email protected]>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox