{"id":9417,"date":"2016-11-25T15:02:36","date_gmt":"2016-11-25T14:02:36","guid":{"rendered":"https:\/\/www.dbi-services.com\/blog\/can-i-do-it-with-postgresql-3-tablespaces\/"},"modified":"2016-11-25T15:02:36","modified_gmt":"2016-11-25T14:02:36","slug":"can-i-do-it-with-postgresql-3-tablespaces","status":"publish","type":"post","link":"https:\/\/www.dbi-services.com\/blog\/can-i-do-it-with-postgresql-3-tablespaces\/","title":{"rendered":"Can I do it with PostgreSQL? &#8211; 3 &#8211; Tablespaces"},"content":{"rendered":"<p>In the last posts of this series we talked about <a href=\"http:\/\/dbi-services.com\/blog\/can-i-do-it-with-postgresql-1-restore-points\/\" target=\"_blank\" rel=\"noopener\">restore points<\/a> and how you could do things <a href=\"http:\/\/dbi-services.com\/blog\/can-i-do-it-with-postgresql-2-dual\/\" target=\"_blank\" rel=\"noopener\">that would require the dual table in Oracle<\/a>. In this post we&#8217;ll look at tablespaces. This is one of the features that is available in PostgreSQL but is totally different from what you know from Oracle. In Oracle you need to create a datafile which is attached to a tablespace. Once you have this you can start creating tables in there if you have the permissions to do so. How does this work in PostgreSQL?<\/p>\n<p><!--more--><\/p>\n<p>Before we start playing with our own tablespaces you need to know that there are two default <a href=\"https:\/\/www.postgresql.org\/docs\/current\/static\/manage-ag-tablespaces.html\" target=\"_blank\" rel=\"noopener\">tablespaces<\/a> in each PostgreSQL instance:<\/p>\n<pre class=\"brush: sql; gutter: true; first-line: 1\">(postgres@[local]:5439) [postgres] &gt; db+\n                                  List of tablespaces\n    Name    |  Owner   | Location | Access privileges | Options |  Size  | Description \n------------+----------+----------+-------------------+---------+--------+-------------\n pg_default | postgres |          |                   |         | 21 MB  | \n pg_global  | postgres |          |                   |         | 497 kB | \n(2 rows)\n<\/pre>\n<p>When you create a table and do not specify in which tablespace you want to get it created it will be created in the pg_default tablespace (this is the default tablespace for template0 and template1 and therefore will be the default for every user created database if not overwritten). pg_global contains the shared system catalog.<\/p>\n<p>This means, whenever you create a table without specifying a tablespace in the create table statement it will go to the pg_default tablespace:<\/p>\n<pre class=\"brush: sql; gutter: true; first-line: 1\">(postgres@[local]:5439) [postgres] &gt; create table t1 ( a int );\nCREATE TABLE\nTime: 99.609 ms\n(postgres@[local]:5439) [postgres] &gt; select tablespace from pg_tables where tablename = 't1';\n tablespace \n------------\n NULL\n(1 row)\n<\/pre>\n<p>NULL, in this case, means default. If you want to know where exactly the files that make up the tables are you can use <a href=\"https:\/\/www.postgresql.org\/docs\/9.6\/static\/oid2name.html\" target=\"_blank\" rel=\"noopener\">oid2name<\/a>:<\/p>\n<pre class=\"brush: sql; gutter: true; first-line: 1\">postgres@pgbox:\/home\/postgres\/ [PG961] oid2name -t t1\nFrom database \"postgres\":\n  Filenode  Table Name\n----------------------\n     24592          t1\npostgres@pgbox:\/home\/postgres\/ [PG961] find $PGDATA -name 2459*\n\/u02\/pgdata\/PG961\/base\/13322\/24592\n<\/pre>\n<p>In addition oid2name tells you more about the databases and the default tablespace associated to them:<\/p>\n<pre class=\"brush: sql; gutter: true; first-line: 1\">postgres@pgbox:\/home\/postgres\/ [PG961] oid2name \nAll databases:\n    Oid  Database Name  Tablespace\n----------------------------------\n  13322       postgres  pg_default\n  13321      template0  pg_default\n      1      template1  pg_default\n<\/pre>\n<p>So far for the basics. Time to create our own tablespace. When you look at the syntax:<\/p>\n<pre class=\"brush: sql; gutter: true; first-line: 1\">(postgres@[local]:5439) [postgres] &gt; h create tablespace\nCommand:     CREATE TABLESPACE\nDescription: define a new tablespace\nSyntax:\nCREATE TABLESPACE tablespace_name\n    [ OWNER { new_owner | CURRENT_USER | SESSION_USER } ]\n    LOCATION 'directory'\n    [ WITH ( tablespace_option = value [, ... ] ) ]\n<\/pre>\n<p>&#8230; this is quite different from what you know when you work with Oracle. The important point for now is the &#8220;LOCATION&#8221;. This refers to a directory somewhere the PostgreSQL owner has write access to. This can be a local directory, can be a directory on any storage the host has access to and it even can be on a ramdisk. It really doesn&#8217;t matter as long as the PostgreSQL OS user has write permissions to it.<\/p>\n<p>Lets create our first tablespace:<\/p>\n<pre class=\"brush: sql; gutter: true; first-line: 1\">(postgres@[local]:5439) [postgres] &gt; ! mkdir \/var\/tmp\/tbs1\n(postgres@[local]:5439) [postgres] &gt; create tablespace tbs1 location '\/var\/tmp\/tbs1';\nCREATE TABLESPACE\nTime: 26.362 ms\n(postgres@[local]:5439) [postgres] &gt; db+\n                                     List of tablespaces\n    Name    |  Owner   |   Location    | Access privileges | Options |  Size   | Description \n------------+----------+---------------+-------------------+---------+---------+-------------\n pg_default | postgres |               |                   |         | 21 MB   | \n pg_global  | postgres |               |                   |         | 497 kB  | \n tbs1       | postgres | \/var\/tmp\/tbs1 |                   |         | 0 bytes | \n(3 rows)\n<\/pre>\n<p>What happened? The first thing to notice is that we can now see the &#8220;Location&#8221; column populated when we display all the tablespaces and that the size of our new tablespace is zero (well, not surprising as nothing is created in the tablespace right now). Did PostgreSQL already create datafiles in this location you might ask?<\/p>\n<pre class=\"brush: sql; gutter: true; first-line: 1\">(postgres@[local]:5439) [postgres] &gt; ! ls -l \/var\/tmp\/tbs1\/\ntotal 0\ndrwx------. 2 postgres postgres 6 Nov 25 11:03 PG_9.6_201608131\n<\/pre>\n<p>At least a directory which contains the version of PostgreSQL was created. What is inside this directory?<\/p>\n<pre class=\"brush: sql; gutter: true; first-line: 1\">(postgres@[local]:5439) [postgres] &gt; ! ls -l \/var\/tmp\/tbs1\/PG_9.6_201608131\/\ntotal 0\n<\/pre>\n<p>Nothing, so lets create a table in this brand new tablespace:<\/p>\n<pre class=\"brush: sql; gutter: true; first-line: 1\">(postgres@[local]:5439) [postgres] &gt; create table t1 ( a int ) tablespace tbs1;\nCREATE TABLE\n(postgres@[local]:5439) [postgres] &gt; d+ t1\n                          Table \"public.t1\"\n Column |  Type   | Modifiers | Storage | Stats target | Description \n--------+---------+-----------+---------+--------------+-------------\n a      | integer |           | plain   |              | \nTablespace: \"tbs1\"\n<\/pre>\n<p>How does the directory look like now?:<\/p>\n<pre class=\"brush: sql; gutter: true; first-line: 1\">(postgres@[local]:5439) [postgres] &gt; ! ls -l \/var\/tmp\/tbs1\/PG_9.6_201608131\/\ntotal 0\ndrwx------. 2 postgres postgres 18 Nov 25 12:02 13322\n<\/pre>\n<p>Ok, 13322 is the OID of the database which the table belongs to:<\/p>\n<pre class=\"brush: sql; gutter: true; first-line: 1\">(postgres@[local]:5439) [postgres] &gt; ! oid2name\nAll databases:\n    Oid  Database Name  Tablespace\n----------------------------------\n  13322       postgres  pg_default\n  13321      template0  pg_default\n      1      template1  pg_default\n<\/pre>\n<p>And below that?<\/p>\n<pre class=\"brush: sql; gutter: true; first-line: 1\">(postgres@[local]:5439) [postgres] &gt; ! ls -l \/var\/tmp\/tbs1\/PG_9.6_201608131\/13322\/\ntotal 0\n-rw-------. 1 postgres postgres 0 Nov 25 12:02 24596\n<\/pre>\n<p>This is the OID of the table. So in summary this is the layout you get per tablespace:<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">|\n|---[LOCATION]\n|       |\n|       | ----- [FIXED_VERSION_DIRECTORY]\n|       |                  |\n|       |                  |---------[DATABASE_OID]\n|       |                  |              |\n|       |                  |              |-----------[TABLE_AND_INDEX_FILES_OID]\n<\/pre>\n<p>One point that is often forgotten is that you can set various parameters on a tablespace level:<\/p>\n<pre class=\"brush: sql; gutter: true; first-line: 1; highlight: [4]\">CREATE TABLESPACE tablespace_name\n    [ OWNER { new_owner | CURRENT_USER | SESSION_USER } ]\n    LOCATION 'directory'\n    [ WITH ( tablespace_option = value [, ... ] ) ]\n<\/pre>\n<p>What you can set per tablespace is:<\/p>\n<ul>\n<li><a href=\"https:\/\/www.postgresql.org\/docs\/current\/static\/runtime-config-query.html#GUC-SEQ-PAGE-COST\" target=\"_blank\" rel=\"noopener\">seq_page_cost<\/a><\/li>\n<li><a href=\"https:\/\/www.postgresql.org\/docs\/current\/static\/runtime-config-query.html#GUC-RANDOM-PAGE-COST\" target=\"_blank\" rel=\"noopener\">random_page_cost<\/a><\/li>\n<li><a href=\"https:\/\/www.postgresql.org\/docs\/current\/static\/runtime-config-resource.html#GUC-EFFECTIVE-IO-CONCURRENCY\" target=\"_blank\" rel=\"noopener\">effective_io_concurrency<\/a><\/li>\n<\/ul>\n<p>This can be very helpful when you have tablespaces on disks (ramdisk?) that have very different performance specifications.<\/p>\n<p>A very important point to keep in mind: Each tablespace you create in PostgreSQL creates a symlink in the clusters data directory:<\/p>\n<pre class=\"brush: sql; gutter: true; first-line: 1\">CREATE TABLESPACE tablespace_name\npostgres@pgbox:\/home\/postgres\/ [PG961] ls -l $PGDATA\/pg_tblspc \ntotal 0\nlrwxrwxrwx. 1 postgres postgres 13 Nov 25 11:03 24595 -&gt; \/var\/tmp\/tbs1\n<\/pre>\n<p>Again, the number (24595) is the OID, in this case of the tablespace:<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">|\n(postgres@[local]:5439) [postgres] &gt; select oid,spcname from pg_tablespace where spcname = 'tbs1';\n  oid  | spcname \n-------+---------\n 24595 | tbs1\n(1 row)\n<\/pre>\n<p>This is important to know because when you do backups of you PostgreSQL instance it is critical that you backup the tablespaces as well. You can find all the pointers\/symlinks in the pg_tblspc directory.<\/p>\n<p>What else can you do with tablespaces? Of course you can change the default tablespace for the whole instance:<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">|\n(postgres@[local]:5439) [postgres] &gt; alter system set default_tablespace='tbs1';\nALTER SYSTEM\nTime: 120.406 ms\n\n(postgres@[local]:5439) [postgres] &gt; select pg_reload_conf();\n pg_reload_conf \n----------------\n t\n(1 row)\n\nTime: 4.279 ms\n(postgres@[local]:5439) [postgres] &gt; show default_tablespace ;\n default_tablespace \n--------------------\n tbs1\n(1 row)\n<\/pre>\n<p>You can assign a tablespace to a database:<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">|\n(postgres@[local]:5439) [postgres] &gt; create database db1 TABLESPACE = tbs1;\nCREATE DATABASE\nTime: 1128.020 ms\n(postgres@[local]:5439) [postgres] &gt; l+\n                                                                    List of databases\n   Name    |  Owner   | Encoding |   Collate   |    Ctype    |   Access privileges   |  Size   | Tablespace |                Description                 \n-----------+----------+----------+-------------+-------------+-----------------------+---------+------------+--------------------------------------------\n db1       | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 |                       | 7233 kB | tbs1       | \n postgres  | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 |                       | 7343 kB | pg_default | default administrative connection database\n template0 | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c\/postgres          +| 7233 kB | pg_default | unmodifiable empty database\n           |          |          |             |             | postgres=CTc\/postgres |         |            | \n template1 | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c\/postgres          +| 7233 kB | pg_default | default template for new databases\n           |          |          |             |             | postgres=CTc\/postgres |         |            | \n<\/pre>\n<p>You can make someone else the owner of a tablespace:<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">|\n(postgres@[local]:5439) [postgres] &gt; create user u1 password 'u1';\nCREATE ROLE\nTime: 31.414 ms\n(postgres@[local]:5439) [postgres] &gt; ALTER TABLESPACE tbs1 OWNER TO u1;\nALTER TABLESPACE\nTime: 2.072 ms\n(postgres@[local]:5439) [postgres] &gt; db\n          List of tablespaces\n    Name    |  Owner   |   Location    \n------------+----------+---------------\n pg_default | postgres | \n pg_global  | postgres | \n tbs1       | u1       | \/var\/tmp\/tbs1\n(3 rows)\n<\/pre>\n<p>And finally you can set one or more tablespaces to be used as temporary tablespaces:<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">|\n(postgres@[local]:5439) [postgres] &gt; alter system set temp_tablespaces='tbs1';\nALTER SYSTEM\nTime: 4.175 ms\n\n(postgres@[local]:5439) [postgres] &gt; select pg_reload_conf();\n pg_reload_conf \n----------------\n t\n(1 row)\n\nTime: 3.638 ms\n(postgres@[local]:5439) [postgres] &gt; show temp_tablespaces ;\n temp_tablespaces \n------------------\n tbs1\n(1 row)\n\n<\/pre>\n<p>Conclusion: Yes, you can have tablespaces in PostgreSQL and they give you great flexibility on how you can organize your PostgreSQL files on disk. The implementation is very different from other vendors, though.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In the last posts of this series we talked about restore points and how you could do things that would require the dual table in Oracle. In this post we&#8217;ll look at tablespaces. This is one of the features that is available in PostgreSQL but is totally different from what you know from Oracle. In [&hellip;]<\/p>\n","protected":false},"author":29,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[229],"tags":[77,36],"type_dbi":[],"class_list":["post-9417","post","type-post","status-publish","format-standard","hentry","category-database-administration-monitoring","tag-postgresql","tag-tablespaces"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.2 (Yoast SEO v27.2) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Can I do it with PostgreSQL? - 3 - Tablespaces - dbi Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.dbi-services.com\/blog\/can-i-do-it-with-postgresql-3-tablespaces\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Can I do it with PostgreSQL? - 3 - Tablespaces\" \/>\n<meta property=\"og:description\" content=\"In the last posts of this series we talked about restore points and how you could do things that would require the dual table in Oracle. In this post we&#8217;ll look at tablespaces. This is one of the features that is available in PostgreSQL but is totally different from what you know from Oracle. In [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.dbi-services.com\/blog\/can-i-do-it-with-postgresql-3-tablespaces\/\" \/>\n<meta property=\"og:site_name\" content=\"dbi Blog\" \/>\n<meta property=\"article:published_time\" content=\"2016-11-25T14:02:36+00:00\" \/>\n<meta name=\"author\" content=\"Daniel Westermann\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@westermanndanie\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Daniel Westermann\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/can-i-do-it-with-postgresql-3-tablespaces\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/can-i-do-it-with-postgresql-3-tablespaces\/\"},\"author\":{\"name\":\"Daniel Westermann\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/8d08e9bd996a89bd75c0286cbabf3c66\"},\"headline\":\"Can I do it with PostgreSQL? &#8211; 3 &#8211; Tablespaces\",\"datePublished\":\"2016-11-25T14:02:36+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/can-i-do-it-with-postgresql-3-tablespaces\/\"},\"wordCount\":678,\"commentCount\":0,\"keywords\":[\"PostgreSQL\",\"Tablespaces\"],\"articleSection\":[\"Database Administration &amp; Monitoring\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.dbi-services.com\/blog\/can-i-do-it-with-postgresql-3-tablespaces\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/can-i-do-it-with-postgresql-3-tablespaces\/\",\"url\":\"https:\/\/www.dbi-services.com\/blog\/can-i-do-it-with-postgresql-3-tablespaces\/\",\"name\":\"Can I do it with PostgreSQL? - 3 - Tablespaces - dbi Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#website\"},\"datePublished\":\"2016-11-25T14:02:36+00:00\",\"author\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/8d08e9bd996a89bd75c0286cbabf3c66\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/can-i-do-it-with-postgresql-3-tablespaces\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.dbi-services.com\/blog\/can-i-do-it-with-postgresql-3-tablespaces\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/can-i-do-it-with-postgresql-3-tablespaces\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Accueil\",\"item\":\"https:\/\/www.dbi-services.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Can I do it with PostgreSQL? &#8211; 3 &#8211; Tablespaces\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#website\",\"url\":\"https:\/\/www.dbi-services.com\/blog\/\",\"name\":\"dbi Blog\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.dbi-services.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/8d08e9bd996a89bd75c0286cbabf3c66\",\"name\":\"Daniel Westermann\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/secure.gravatar.com\/avatar\/31350ceeecb1dd8986339a29bf040d4cd3cd087d410deccd8f55234466d6c317?s=96&d=mm&r=g\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/31350ceeecb1dd8986339a29bf040d4cd3cd087d410deccd8f55234466d6c317?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/31350ceeecb1dd8986339a29bf040d4cd3cd087d410deccd8f55234466d6c317?s=96&d=mm&r=g\",\"caption\":\"Daniel Westermann\"},\"description\":\"Daniel Westermann is Principal Consultant and Technology Leader Open Infrastructure at dbi services. He has more than 15 years of experience in management, engineering and optimization of databases and infrastructures, especially on Oracle and PostgreSQL. Since the beginning of his career, he has specialized in Oracle Technologies and is Oracle Certified Professional 12c and Oracle Certified Expert RAC\/GridInfra. Over time, Daniel has become increasingly interested in open source technologies, becoming \u201cTechnology Leader Open Infrastructure\u201d and PostgreSQL expert. \u00a0Based on community or EnterpriseDB tools, he develops and installs complex high available solutions with PostgreSQL. He is also a certified PostgreSQL Plus 9.0 Professional and a Postgres Advanced Server 9.4 Professional. He is a regular speaker at PostgreSQL conferences in Switzerland and Europe. Today Daniel is also supporting our customers on AWS services such as AWS RDS, database migrations into the cloud, EC2 and automated infrastructure management with AWS SSM (System Manager). He is a certified AWS Solutions Architect Professional. Prior to dbi services, Daniel was Management System Engineer at LC SYSTEMS-Engineering AG in Basel. Before that, he worked as Oracle Developper &amp;\u00a0Project Manager at Delta Energy Solutions AG in Basel (today Powel AG). Daniel holds a diploma in Business Informatics (DHBW, Germany). His branch-related experience mainly covers the pharma industry, the financial sector, energy, lottery and telecommunications.\",\"sameAs\":[\"https:\/\/x.com\/westermanndanie\"],\"url\":\"https:\/\/www.dbi-services.com\/blog\/author\/daniel-westermann\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Can I do it with PostgreSQL? - 3 - Tablespaces - dbi Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.dbi-services.com\/blog\/can-i-do-it-with-postgresql-3-tablespaces\/","og_locale":"en_US","og_type":"article","og_title":"Can I do it with PostgreSQL? - 3 - Tablespaces","og_description":"In the last posts of this series we talked about restore points and how you could do things that would require the dual table in Oracle. In this post we&#8217;ll look at tablespaces. This is one of the features that is available in PostgreSQL but is totally different from what you know from Oracle. In [&hellip;]","og_url":"https:\/\/www.dbi-services.com\/blog\/can-i-do-it-with-postgresql-3-tablespaces\/","og_site_name":"dbi Blog","article_published_time":"2016-11-25T14:02:36+00:00","author":"Daniel Westermann","twitter_card":"summary_large_image","twitter_creator":"@westermanndanie","twitter_misc":{"Written by":"Daniel Westermann","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.dbi-services.com\/blog\/can-i-do-it-with-postgresql-3-tablespaces\/#article","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/can-i-do-it-with-postgresql-3-tablespaces\/"},"author":{"name":"Daniel Westermann","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/8d08e9bd996a89bd75c0286cbabf3c66"},"headline":"Can I do it with PostgreSQL? &#8211; 3 &#8211; Tablespaces","datePublished":"2016-11-25T14:02:36+00:00","mainEntityOfPage":{"@id":"https:\/\/www.dbi-services.com\/blog\/can-i-do-it-with-postgresql-3-tablespaces\/"},"wordCount":678,"commentCount":0,"keywords":["PostgreSQL","Tablespaces"],"articleSection":["Database Administration &amp; Monitoring"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.dbi-services.com\/blog\/can-i-do-it-with-postgresql-3-tablespaces\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.dbi-services.com\/blog\/can-i-do-it-with-postgresql-3-tablespaces\/","url":"https:\/\/www.dbi-services.com\/blog\/can-i-do-it-with-postgresql-3-tablespaces\/","name":"Can I do it with PostgreSQL? - 3 - Tablespaces - dbi Blog","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/#website"},"datePublished":"2016-11-25T14:02:36+00:00","author":{"@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/8d08e9bd996a89bd75c0286cbabf3c66"},"breadcrumb":{"@id":"https:\/\/www.dbi-services.com\/blog\/can-i-do-it-with-postgresql-3-tablespaces\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.dbi-services.com\/blog\/can-i-do-it-with-postgresql-3-tablespaces\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.dbi-services.com\/blog\/can-i-do-it-with-postgresql-3-tablespaces\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Accueil","item":"https:\/\/www.dbi-services.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Can I do it with PostgreSQL? &#8211; 3 &#8211; Tablespaces"}]},{"@type":"WebSite","@id":"https:\/\/www.dbi-services.com\/blog\/#website","url":"https:\/\/www.dbi-services.com\/blog\/","name":"dbi Blog","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.dbi-services.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/8d08e9bd996a89bd75c0286cbabf3c66","name":"Daniel Westermann","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/31350ceeecb1dd8986339a29bf040d4cd3cd087d410deccd8f55234466d6c317?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/31350ceeecb1dd8986339a29bf040d4cd3cd087d410deccd8f55234466d6c317?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/31350ceeecb1dd8986339a29bf040d4cd3cd087d410deccd8f55234466d6c317?s=96&d=mm&r=g","caption":"Daniel Westermann"},"description":"Daniel Westermann is Principal Consultant and Technology Leader Open Infrastructure at dbi services. He has more than 15 years of experience in management, engineering and optimization of databases and infrastructures, especially on Oracle and PostgreSQL. Since the beginning of his career, he has specialized in Oracle Technologies and is Oracle Certified Professional 12c and Oracle Certified Expert RAC\/GridInfra. Over time, Daniel has become increasingly interested in open source technologies, becoming \u201cTechnology Leader Open Infrastructure\u201d and PostgreSQL expert. \u00a0Based on community or EnterpriseDB tools, he develops and installs complex high available solutions with PostgreSQL. He is also a certified PostgreSQL Plus 9.0 Professional and a Postgres Advanced Server 9.4 Professional. He is a regular speaker at PostgreSQL conferences in Switzerland and Europe. Today Daniel is also supporting our customers on AWS services such as AWS RDS, database migrations into the cloud, EC2 and automated infrastructure management with AWS SSM (System Manager). He is a certified AWS Solutions Architect Professional. Prior to dbi services, Daniel was Management System Engineer at LC SYSTEMS-Engineering AG in Basel. Before that, he worked as Oracle Developper &amp;\u00a0Project Manager at Delta Energy Solutions AG in Basel (today Powel AG). Daniel holds a diploma in Business Informatics (DHBW, Germany). His branch-related experience mainly covers the pharma industry, the financial sector, energy, lottery and telecommunications.","sameAs":["https:\/\/x.com\/westermanndanie"],"url":"https:\/\/www.dbi-services.com\/blog\/author\/daniel-westermann\/"}]}},"_links":{"self":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/9417","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/users\/29"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/comments?post=9417"}],"version-history":[{"count":0,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/9417\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/media?parent=9417"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/categories?post=9417"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/tags?post=9417"},{"taxonomy":"type","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/type_dbi?post=9417"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}