HiveBrain v1.2.0
Get Started
← Back to all entries
principleMinor

Compare the tablespace concept between Postgres and Oracle

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
oraclethetablespacepostgresconceptbetweenandcompare

Problem

When I create a table, it is placed in a default tablespace such as "USERS", unless I specify a user created tablespace, say, MyTableSpace.

For example,

create table test_tab(

name varchar2(100),
photo BLOB,
text   CLOB
)
tablespace "USERS"   --default
lob ("photo")  tablespace "MyTableSpace"   --user created
lob ("text")  tablespace "MyTableSpace"    --user created


Now, convert the above table to the counterpart in Postgres. Where could those columns be placed?

A default tablespace? User create tablespace? Or some proprietary logical structure in Postgres?

Solution

In PostgreSQL, if you don't specify a tablespace in your CREATE TABLE command, the value of parameter default_tablespace will be used.

If default_tablespace is not set, or has an invalid value, the table will be created in the same tablespace as the database.

https://demo.pganalyze.com/databases/6/config/default_tablespace

Context

StackExchange Database Administrators Q#126881, answer score: 2

Revisions (0)

No revisions yet.