Re: what is the solution like oracle DB's datafile

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: Yudianto Prasetyo <mr(dot)yudianto(at)gmail(dot)com>, pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: what is the solution like oracle DB's datafile
Date: 2022-01-31 05:10:27
Message-ID: ef0104dee2cc688c56664cb4fb6bb660328743d1.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sun, 2022-01-30 at 05:15 +0700, Yudianto Prasetyo wrote:
> I want to ask why postgresql doesn't create a datafile like it has oracle?
>
> I'm confused when I have 2 HDD. HDD 1 is used to install the OS and postgresql database.
> when HDD 1 is full. how to increase the capacity of postgresql database with HDD 2 (without RAID system)?
>
> is there any other way like oracle DB's "add datafile" which can be used to add capacity to another HDD?

The difference between Oracle and PostgreSQL here is that Oracle implemented its
own file system and volume manager, while PostgreSQL uses the facilities provided
by the operating system.

The correspondence is not perfect, but you can compare an Oracle tablespace to
a logical volume with a file system and a datafile to a physical volume.

So to get the same thing in PostgreSQL, you have to interact with the operating
system: add a new physical volume to the logical volume where your database
resides and extend the file system.

To answer the question "why", here are two points:

- PostgreSQL does not have the (wo)manpower to re-invent the wheel on everything,
so we tend to use existing facilities

- Oracle was developed earlier, and one can argue that in those days file systems
were not so great, so there was more need to write your own

Yours,
Laurenz Albe
--
Cybertec | https://www.cybertec-postgresql.com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ketan Popat 2022-01-31 08:07:02 Can one call pg_total_relation_size over foreign data wrapper?
Previous Message Yudianto Prasetyo 2022-01-30 22:13:32 Re: what is the solution like oracle DB's datafile