Re: My 1st TABLESPACE

From: KK CHN <kkchn(dot)in(at)gmail(dot)com>
To: Amn Ojee Uw <amnojeeuw(at)gmail(dot)com>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: My 1st TABLESPACE
Date: 2023-08-08 09:33:48
Message-ID: CAKgGyB_=PaprUteWqhOYmKSCNCVMmjF34meX0x7rXaEa9O_3vA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, Aug 7, 2023 at 5:47 PM Amn Ojee Uw <amnojeeuw(at)gmail(dot)com> wrote:

> Thanks Negora.
>
> Makes sense, I will check it out.
>
> On 8/7/23 1:48 a.m., negora wrote:
>
> Hi:
>
> Although the "postgres" user owns the "data" directory, Has he access to
> the whole branch of directories? Maybe the problem is that he can't reach
> the "data" directory.
>
> Regards.
>
>
> On 07/08/2023 07:43, Amn Ojee Uw wrote:
>
> I'd like to create a TABLESPACE, so, following this web page
> <https://www.postgresql.org/docs/current/sql-createtablespace.html>, I
> have done the following :
>
> *mkdir
> /home/my_debian_account/Documents/NetbeansWorkSpace/JavaSE/Jme/database/postgresql/data*
>
> *sudo chown postgres:postgres
> /home/my_debian_account/Documents/NetbeansWorkSpace/JavaSE/Jme/database/postgresql/data*
>
> *sudo -u postgres psql*
>
> *\du*
> * arbolone | Cannot login | {}*
> * chispa
> | | {prosafe}*
> * workerbee | Superuser, Create DB | {arbolone}*
> * jme
> | | {arbolone}*
> * postgres | Superuser, Create role, Create DB, Replication, Bypass RLS
> | {}*
> * prosafe | Cannot login | {}*
>
> *CREATE TABLESPACE jmetablespace OWNER jme LOCATION
> '/home/my_debian_account/Documents/NetbeansWorkSpace/JavaSE/Jme/database/postgresql/data';*
>
>
Here owner is jme and the data dir you created must have owner jme..

> The *CREATE **TABLESPACE* schema throws this error message :
>
> *ERROR: could not set permissions on directory
> "/home/my_debian_account/Documents/NetbeansWorkSpace/JavaSE/Jme/database/postgresql/data":
> Permission denied*
>
> I have followed the web page to the best of my abilities, and AFAIK, the
> postgres user owns the folder '*data*'.
>
> I know that something is missing, where did I go wrong and how can I
> resolve this issue?
>
>
> Thanks in advance.
>
>
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Marc Millas 2023-08-08 11:59:31 Re: DB Server slow down & hang during Peak hours of Usage
Previous Message Meera Nair 2023-08-08 07:39:48 PostgreSQL 14.8 - server fails to start even though all transaction logs with base backup are restored