From: Amn Ojee Uw <amnojeeuw@gmail.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: Creating a TABLESPACE
Date: Wed, 16 Aug 2023 13:24:01 -0400
Message-ID: <00e0d52b-cd7d-ca02-a5ba-66151fc83211@gmail.com> (raw)
In-Reply-To: <CAN6i3YO-1LxHoZex9z_1DDOuM3+gS6B58iKG+e92ebJAxHEPBw@mail.gmail.com>
References: <b099918b-aeb5-397b-b22b-f08a27c61198@gmail.com>
<CAN6i3YO-1LxHoZex9z_1DDOuM3+gS6B58iKG+e92ebJAxHEPBw@mail.gmail.com>
Yes!
Thank you Mateusz.
On 8/16/23 6:43 a.m., Mateusz Henicz wrote:
> Hey,
> You are using "WITH tablespace_option" wrong.
>
> Try it like this:
>
> postgres=# CREATE TABLESPACE jme_tablespace OWNER jamiil LOCATION
> '/database' WITH
> (seq_page_cost=1.0,random_page_cost=4.0,effective_io_concurrency=1);
> CREATE TABLESPACE
>
> Cheers,
> Mateusz
>
> śr., 16 sie 2023 o 12:10 Amn Ojee Uw <amnojeeuw@gmail.com> napisał(a):
>
> Hello children!
>
> I am learning how to create a tablespace, and AFAIK this are the
> steps to follow.
>
> First step is to create the directory where the database files
> will be created, for that I am using the root directory
> '/database'. This directory is be owned by the postgres group.
>
> Example :
> sudo mkdir /database
> sudo chown postgres:postgres /database
>
> I read the following documentation
> 1.) TABLESPACE
> <https://www.postgresql.org/docs/current/sql-createtablespace.html;
>
> 2.) seq_page_cost
> <https://www.postgresql.org/docs/current/runtime-config-query.html#GUC-SEQ-PAGE-COST;
>
> 3.) effective_io_concurrency
> <https://www.postgresql.org/docs/current/runtime-config-resource.html#GUC-EFFECTIVE-IO-CONCURRENCY;
>
> 4.) maintenance_io_concurrency
> <https://www.postgresql.org/docs/current/runtime-config-resource.html#GUC-MAINTENANCE-IO-CONCURRENCY;
>
> 5.) Tablespaces
> <https://www.postgresql.org/docs/current/manage-ag-tablespaces.html;
>
> x.) effective_io_concurrency
> <https://manpages.debian.org/testing/manpages-dev/posix_fadvise.2.en.html;
>
> I then login PostgreSQL as so : sudo -u postgres psql.
>
> Note : _/*jamiil*/_ is an actual account, it does exist!
>
> I proceed to create the 'TABLESPACE' using the default values in
> PostgreSQL
>
> CREATE TABLESPACE jme_tablespace OWNER jamiil LOCATION '/database'
> WITH tablespace_option = seq_page_cost(1.0), random_page_cost
> (4.0), effective_io_concurrency (1), maintenance_io_concurrency (10);
>
> But then I get this error message:
> *ERROR: syntax error at or near "tablespace_option"**
> **LINE 1: ...tablespace OWNER jamiil LOCATION '/database' WITH
> tablespace...*
>
> What did I go wrong?
>
> This exercise is not imperative, but as a student of PostgreSQL
> I'd like to try all there is to learn about PostgreSQL.
>
> Thanks in advance for your time and interest.
>
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: amnojeeuw@gmail.com
Subject: Re: Creating a TABLESPACE
In-Reply-To: <00e0d52b-cd7d-ca02-a5ba-66151fc83211@gmail.com>
References: <b099918b-aeb5-397b-b22b-f08a27c61198@gmail.com> <CAN6i3YO-1LxHoZex9z_1DDOuM3+gS6B58iKG+e92ebJAxHEPBw@mail.gmail.com> <00e0d52b-cd7d-ca02-a5ba-66151fc83211@gmail.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