pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Holger Jakobs <holger@jakobs.com>
To: pgsql-admin@lists.postgresql.org
Subject: Re: database on selected disk
Date: Tue, 19 Oct 2021 07:51:46 +0200
Message-ID: <842cebe7-93c9-2ea0-0b64-4d4603348f26@jakobs.com> (raw)
In-Reply-To: <CAPGSW3Ruyer1SHLSV6ZQc9cLvUiQ_yFpMsLRVvXQb9SpY4C5VA@mail.gmail.com>
References: <CAPGSW3Ruyer1SHLSV6ZQc9cLvUiQ_yFpMsLRVvXQb9SpY4C5VA@mail.gmail.com>

Am 18.10.21 um 19:04 schrieb Zahid Rahman:
> Hi
>
> I have two disks attached to my Raspberry pi 4 .
>
> One disk is a 2TB with a partition called postgres on   /dev/sdb/sd1 .
> When creating databases this is where I wish to create them.
>
> This is not the disk with the operating system installed .
> If I install postgres with pgadmin using  apt install,
> any database I create  will be installed on  disk /dev/sda/sda1 by default.
>
> Can you please give me a HOW-TO on choosing the partition on a
> particular disk  when creating a database  or perhaps even a table.
>
> Thanks
> Zahid
>
>
Hi Zahid,

when setting up a database cluster with initdb, you determine the 
directory path for the cluster.

So make sure the directory path resides on the disk you want it to be.

What is also possible is using a symbolic link to redirect to another 
directory on the intended disk.

On the other hand, it's not possible to have some databases of a cluster 
on one drive and some on another. A database cluster cannot be 
distributed among disks.

Since you can have any number of database clusters on a machine, this 
doesn't impose a problem.

Regards,

Holger

-- 
Holger Jakobs, Bergisch Gladbach, Tel. +49-178-9759012



Attachments:

  OpenPGP_signature (application/pgp-signature, 202B) download

view thread (5+ messages)  latest in thread

Message-ID: <842cebe7-93c9-2ea0-0b64-4d4603348f26@jakobs.com>
Permalink:  ../842cebe7-93c9-2ea0-0b64-4d4603348f26@jakobs.com/
Also on:    postgresql.org/message-id/842cebe7-93c9-2ea0-0b64-4d4603348f26@jakobs.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: holger@jakobs.com, pgsql-admin@lists.postgresql.org
  Subject: Re: database on selected disk
  In-Reply-To: <842cebe7-93c9-2ea0-0b64-4d4603348f26@jakobs.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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