Creating a TABLESPACE
Creating a TABLESPACE
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
2.) seq_page_cost
3.) effective_io_concurrency
4.) maintenance_io_concurrency
5.) Tablespaces
x.) effective_io_concurrency
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.
Re: Creating a TABLESPACE
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
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 /databaseI read the following documentation
1.) TABLESPACE
2.) seq_page_cost
3.) effective_io_concurrency
4.) maintenance_io_concurrency
5.) Tablespaces
x.) effective_io_concurrencyI 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.
Re: Creating a TABLESPACE
Hello children!
Born in Arizona, moved to Babylonia.
Re: Creating a TABLESPACE
Yes!
Thank you Mateusz.
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 TABLESPACECheers,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 /databaseI read the following documentation
1.) TABLESPACE
2.) seq_page_cost
3.) effective_io_concurrency
4.) maintenance_io_concurrency
5.) Tablespaces
x.) effective_io_concurrencyI 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.
Re: Creating a TABLESPACE
Sorry, did not mean it that way.
Thanks for the advice.
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.
Re: Creating a TABLESPACE
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.
Re: Creating a TABLESPACE
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