Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qWKFi-002tCA-Uj for pgsql-general@arkaria.postgresql.org; Wed, 16 Aug 2023 17:24:15 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qWKFg-008BzP-NP for pgsql-general@arkaria.postgresql.org; Wed, 16 Aug 2023 17:24:12 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qWKFg-008BuG-4B for pgsql-general@lists.postgresql.org; Wed, 16 Aug 2023 17:24:12 +0000 Received: from mail-qk1-x72f.google.com ([2607:f8b0:4864:20::72f]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qWKFY-000TlO-Jl for pgsql-general@lists.postgresql.org; Wed, 16 Aug 2023 17:24:10 +0000 Received: by mail-qk1-x72f.google.com with SMTP id af79cd13be357-76d72d94173so47499085a.3 for ; Wed, 16 Aug 2023 10:24:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1692206643; x=1692811443; h=in-reply-to:references:to:content-language:subject:user-agent :mime-version:date:message-id:from:from:to:cc:subject:date :message-id:reply-to; bh=yiD8/A7pS88mlqi6NT79IAVklCizUE2lt+ZOyqmC8x4=; b=cmKNf5knd3jHOhmq2+tzBhGfuBmG14ON3CYvLp7vDIUEQet8MUloGAg3b9bkSs0YtF 5DHo0nW76V//lqW21rx0+lmVXKpXd3fuym2bsJgDh3Ru/CCOyibb5NoisiNdN2AVAw3y G4KIkvgLd6BHzZumZdeYcoj9A2f+Gpd6C4zXoZm087JTA0n+OLS1tKOj2ZIcE9MQeWi2 3p4CSyU648QYOdNxB1B4D8NZQbF+nTSYTNXfOLtQE81g2+3uGzxytUB6IAtcipqCBvUz HSTO/wkGG0XYpSI2F1SAd5gUDgKP5Qm4C2ctVeTisvS/ct1DV4VZr6aLnxyUSCKWzBa5 /T7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692206643; x=1692811443; h=in-reply-to:references:to:content-language:subject:user-agent :mime-version:date:message-id:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=yiD8/A7pS88mlqi6NT79IAVklCizUE2lt+ZOyqmC8x4=; b=LBHhLcgLY28+6ifrelCJ7ryCMNDnXyavQi6mDSSGTbFG6pZRh0a5U2suGsOAURLwmt 7d6e2rOVT9VlKMnIJYQ0j2oOnUNCMLI+FBJbg9fJaq53fhUS1mjChNi8xs9ALe1UamAh XbhxaTpX5NmuCfq6tzwMuo4tbg+CwyOjFkk0sO3T8gJsgQTlj943qACTnjkMBO9ei9XM LPl5kseSYth5juGTSW0x7Yt9ZhFYXpj2KzTUSw3qVwK4rsimAH4COcA5teBUAGDXTcwo lDgWfYlAMirSUTUtxDuKHf+E+zKyhwKSgl8AoBYDyWPJGPorOkF5O1rKhkmub3LyiwE2 nzrQ== X-Gm-Message-State: AOJu0YwzIKCnuL22NgkjWUB6yKQcEibdn47NzVzthRAcJ1CsVuQxcECZ iFQCAKWJIfrDl9yvxR2ehWNhK5EuSOc= X-Google-Smtp-Source: AGHT+IG4TApE55Wle7Tk6Mu787XK3YLJepr93uxl95p2NWlxS8yKCywap05BYaCZ5iBcykeMPoTPqw== X-Received: by 2002:a05:620a:c93:b0:768:4206:fa41 with SMTP id q19-20020a05620a0c9300b007684206fa41mr2291759qki.44.1692206643235; Wed, 16 Aug 2023 10:24:03 -0700 (PDT) Received: from [192.168.2.170] (bras-base-bmtnon1319w-grc-34-67-70-150-114.dsl.bell.ca. [67.70.150.114]) by smtp.gmail.com with ESMTPSA id p6-20020a05620a132600b00767660afed5sm4556581qkj.99.2023.08.16.10.24.02 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 16 Aug 2023 10:24:02 -0700 (PDT) From: Amn Ojee Uw X-Google-Original-From: Amn Ojee Uw Content-Type: multipart/alternative; boundary="------------qDnXwEbYRr4cnbNv6gS5nuun" Message-ID: <00e0d52b-cd7d-ca02-a5ba-66151fc83211@gmail.com> Date: Wed, 16 Aug 2023 13:24:01 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.14.0 Subject: Re: Creating a TABLESPACE Content-Language: en-CA, es-ES To: pgsql-general@lists.postgresql.org References: In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------qDnXwEbYRr4cnbNv6gS5nuun Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 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 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 > > > 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. > --------------qDnXwEbYRr4cnbNv6gS5nuun Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit

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

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.

--------------qDnXwEbYRr4cnbNv6gS5nuun--