pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Daulat Ram <Daulat.Ram@exponential.com>
To: Patrick FICHE <Patrick.Fiche@aqsacom.com>
To: amul sul <sulamul@gmail.com>
Cc: pgsql-performance@lists.postgresql.org <pgsql-performance@lists.postgresql.org>
Subject: RE: Can we have multiple tablespaces with in a database.
Date: Sat, 22 Feb 2020 04:45:14 +0000
Message-ID: <MN2PR01MB5854785AB3B1464A05DD15739BEE0@MN2PR01MB5854.prod.exchangelabs.com> (raw)
In-Reply-To: <PR3PR05MB70352CEBC4E0DCA82B4A58CBEF120@PR3PR05MB7035.eurprd05.prod.outlook.com>
References: <MN2PR01MB585418CEA8E057268F18339A9B120@MN2PR01MB5854.prod.exchangelabs.com>
	<CAAJ_b954ug=jYDvNUsnHj3j7yGt_p_nN31C7yDA8eafmOBcGOw@mail.gmail.com>
	<MN2PR01MB5854F35E70DF08D6B5DD4ECA9B120@MN2PR01MB5854.prod.exchangelabs.com>
	<CAAJ_b97HSMVhDvgRQX4XF64k_ACfKKwkZpeaSVF_CjeuPCF9+A@mail.gmail.com>
	<MN2PR01MB5854A53D30A32F75369688729B120@MN2PR01MB5854.prod.exchangelabs.com>
	<PR3PR05MB70352CEBC4E0DCA82B4A58CBEF120@PR3PR05MB7035.eurprd05.prod.outlook.com>

Thanks Patrick ,

From: Patrick FICHE <Patrick.Fiche@aqsacom.com>
Sent: Friday, February 21, 2020 9:54 PM
To: Daulat Ram <Daulat.Ram@exponential.com>; amul sul <sulamul@gmail.com>
Cc: pgsql-performance@lists.postgresql.org
Subject: RE: Can we have multiple tablespaces with in a database.

Hi,

You can create more than one tablespace and assign different objects on different tablespaces.
For example :
CREATE TABLESPACE test_data OWNER test LOCATION '/tmp/test_data';
CREATE TABLESPACE test_idx OWNER test LOCATION '/tmp/test_idx';

CREATE DATABASE test WITH TABLESPACE = test_data;

Then, for example, when create table and index, you can specify
CREATE TABLE test1

(
   id               int               NOT NULL GENERATED ALWAYS AS IDENTITY,
   comment          text,
   CONSTRAINT pk_test PRIMARY KEY
   (
      id
   ) USING INDEX TABLESPACE TEST_IDX
) TABLESPACE TEST_DATA;

CREATE INDEX sk_comment ON test1( comment ) TABLESPACE TEST_IDX;

Patrick Fiche
Database Engineer, Aqsacom Sas.
c. 33 6 82 80 69 96

[01-03_AQSA_Main_Corporate_Logo_JPEG_White_Low.jpg]<http://www.aqsacom.com/;

From: Daulat Ram <Daulat.Ram@exponential.com<mailto:Daulat.Ram@exponential.com>>
Sent: Friday, February 21, 2020 7:23 AM
To: amul sul <sulamul@gmail.com<mailto:sulamul@gmail.com>>
Cc: pgsql-general@lists.postgresql.org<mailto:pgsql-general@lists.postgresql.org>; pgsql-performance@lists.postgresql.org<mailto:pgsql-performance@lists.postgresql.org>
Subject: RE: Can we have multiple tablespaces with in a database.

That will be great if you  share any doc where it’s mentioned that we can’t use multiple tablespace for a single database. I have to assist my Dev team regarding tablespaces.

Also , what are the differences between Oracle and Postgres Tablespacs?

Thanks,


From: amul sul <sulamul@gmail.com<mailto:sulamul@gmail.com>>
Sent: Friday, February 21, 2020 11:48 AM
To: Daulat Ram <Daulat.Ram@exponential.com<mailto:Daulat.Ram@exponential.com>>
Cc: pgsql-general@lists.postgresql.org<mailto:pgsql-general@lists.postgresql.org>; pgsql-performance@lists.postgresql.org<mailto:pgsql-performance@lists.postgresql.org>
Subject: Re: Can we have multiple tablespaces with in a database.



On Fri, Feb 21, 2020 at 11:31 AM Daulat Ram <Daulat.Ram@exponential.com<mailto:Daulat.Ram@exponential.com>> wrote:
Hi Amul ,
Please share the examples how we can create no. of tablespaces for a single database and how we can use them.
As I know we can create database on tablespace

  1.  CREATE TABLESPACE conn_tbs OWNER enterprisedb LOCATION '/mnt/pgdatatest/test/pgdata/conn_tbs';
  2.  Create database test tablespace ‘conn_tbs';
Maybe I have misunderstood your question; there is no option to specify more
than one tablespace for the database, but you can place the objects of that
database to different tablespaces (if options available for that object).
E.g. you can place a table in than conn_tbs tablespace.

If option is not specified then by default that object will be created
in conn_tbs.

Regards,
Amul





Attachments:

image001.png (image/png, 7.6K) download view image

view thread (16+ messages)

Message-ID: <MN2PR01MB5854785AB3B1464A05DD15739BEE0@MN2PR01MB5854.prod.exchangelabs.com>
Permalink:  ../MN2PR01MB5854785AB3B1464A05DD15739BEE0@MN2PR01MB5854.prod.exchangelabs.com/
Also on:    postgresql.org/message-id/MN2PR01MB5854785AB3B1464A05DD15739BEE0@MN2PR01MB5854.prod.exchangelabs.com

 · 

reply

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 using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: Daulat.Ram@exponential.com, Patrick.Fiche@aqsacom.com, sulamul@gmail.com, pgsql-performance@lists.postgresql.org
  Subject: RE: Can we have multiple tablespaces with in a database.
  In-Reply-To: <MN2PR01MB5854785AB3B1464A05DD15739BEE0@MN2PR01MB5854.prod.exchangelabs.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