pg.ddx.io pgsql-general@postgresql.org mailing list archive
help / color / mirror / Atom feedCreating a TABLESPACE
7+ messages / 4 participants
[nested] [flat]
* Creating a TABLESPACE
@ 2023-08-16 10:10 Amn Ojee Uw <amnojeeuw@gmail.com>
0 siblings, 2 replies; 7+ messages in thread
From: Amn Ojee Uw @ 2023-08-16 10:10 UTC (permalink / raw)
To: pgsql-general@lists.postgresql.org
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.
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: Creating a TABLESPACE
@ 2023-08-16 10:43 Mateusz Henicz <mateuszhenicz@gmail.com>
parent: Amn Ojee Uw <amnojeeuw@gmail.com>
1 sibling, 1 reply; 7+ messages in thread
From: Mateusz Henicz @ 2023-08-16 10:43 UTC (permalink / raw)
To: Amn Ojee Uw <amnojeeuw@gmail.com>; +Cc: pgsql-general@lists.postgresql.org
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.
>
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: Creating a TABLESPACE
@ 2023-08-16 15:37 Ron <ronljohnsonjr@gmail.com>
parent: Amn Ojee Uw <amnojeeuw@gmail.com>
1 sibling, 1 reply; 7+ messages in thread
From: Ron @ 2023-08-16 15:37 UTC (permalink / raw)
To: pgsql-general@lists.postgresql.org
Friendly tip: whatever else you do, don't write "Hello children!" in English
to adults. It's *highly insulting*.
On 8/16/23 05:10, Amn Ojee Uw wrote:
>
> Hello children!
>
--
Born in Arizona, moved to Babylonia.
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: Creating a TABLESPACE
@ 2023-08-16 17:24 Amn Ojee Uw <amnojeeuw@gmail.com>
parent: Mateusz Henicz <mateuszhenicz@gmail.com>
0 siblings, 0 replies; 7+ messages in thread
From: Amn Ojee Uw @ 2023-08-16 17:24 UTC (permalink / raw)
To: pgsql-general@lists.postgresql.org
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.
>
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: Creating a TABLESPACE
@ 2023-08-16 17:27 Amn Ojee Uw <amnojeeuw@gmail.com>
parent: Ron <ronljohnsonjr@gmail.com>
0 siblings, 1 reply; 7+ messages in thread
From: Amn Ojee Uw @ 2023-08-16 17:27 UTC (permalink / raw)
To: pgsql-general@lists.postgresql.org
Sorry, did not mean it that way.
Thanks for the advice.
On 8/16/23 11:37 a.m., Ron wrote:
> Friendly tip: whatever else you do, don't write "Hello children!" in
> English to adults. It's *highly insulting*.
>
> On 8/16/23 05:10, Amn Ojee Uw wrote:
>>
>> Hello children!
>>
>
> --
> Born in Arizona, moved to Babylonia.
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: Creating a TABLESPACE
@ 2023-08-16 20:24 Ron <ronljohnsonjr@gmail.com>
parent: Amn Ojee Uw <amnojeeuw@gmail.com>
0 siblings, 1 reply; 7+ messages in thread
From: Ron @ 2023-08-16 20:24 UTC (permalink / raw)
To: pgsql-general@lists.postgresql.org
Speakers of English as a second language are to be tolerated and assisted,
not mocked and insulted.
On 8/16/23 12:27, Amn Ojee Uw wrote:
>
> Sorry, did not mean it that way.
> Thanks for the advice.
>
> On 8/16/23 11:37 a.m., Ron wrote:
>> Friendly tip: whatever else you do, don't write "Hello children!" in
>> English to adults. It's *highly insulting*.
>>
>> On 8/16/23 05:10, Amn Ojee Uw wrote:
>>>
>>> Hello children!
>>>
>>
>> --
>> Born in Arizona, moved to Babylonia.
--
Born in Arizona, moved to Babylonia.
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: Creating a TABLESPACE
@ 2023-08-16 20:29 Ray O'Donnell <ray@rodonnell.ie>
parent: Ron <ronljohnsonjr@gmail.com>
0 siblings, 0 replies; 7+ messages in thread
From: Ray O'Donnell @ 2023-08-16 20:29 UTC (permalink / raw)
To: Ron <ronljohnsonjr@gmail.com>; pgsql-general@lists.postgresql.org
On 16/08/2023 21:24, Ron wrote:
> Speakers of English as a second language are to be tolerated and
> assisted, not mocked and insulted.
+1
I actually found it rather amusing. :-)
Ray.
>
> On 8/16/23 12:27, Amn Ojee Uw wrote:
>>
>> Sorry, did not mean it that way.
>> Thanks for the advice.
>>
>> On 8/16/23 11:37 a.m., Ron wrote:
>>> Friendly tip: whatever else you do, don't write "Hello children!" in
>>> English to adults. It's *highly insulting*.
>>>
>>> On 8/16/23 05:10, Amn Ojee Uw wrote:
>>>>
>>>> Hello children!
>>>>
>>>
>>> --
>>> Born in Arizona, moved to Babylonia.
>
> --
> Born in Arizona, moved to Babylonia.
--
Raymond O'Donnell // Galway // Ireland
ray@rodonnell.ie
^ permalink raw reply [nested|flat] 7+ messages in thread
end of thread, other threads:[~2023-08-16 20:29 UTC | newest]
Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2023-08-16 10:10 Creating a TABLESPACE Amn Ojee Uw <amnojeeuw@gmail.com>
2023-08-16 10:43 ` Mateusz Henicz <mateuszhenicz@gmail.com>
2023-08-16 17:24 ` Amn Ojee Uw <amnojeeuw@gmail.com>
2023-08-16 15:37 ` Ron <ronljohnsonjr@gmail.com>
2023-08-16 17:27 ` Amn Ojee Uw <amnojeeuw@gmail.com>
2023-08-16 20:24 ` Ron <ronljohnsonjr@gmail.com>
2023-08-16 20:29 ` Ray O'Donnell <ray@rodonnell.ie>
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