pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Mladen Gogala <gogala.mladen@gmail.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: what is the solution like oracle DB's datafile
Date: Sun, 30 Jan 2022 12:03:52 -0500
Message-ID: <1f8c76b8-779f-7ea7-52e1-3a48cdfc678c@gmail.com> (raw)
In-Reply-To: <CAN7WH3+HdpkMwXMJGuFCn6FHUZAqxtFo4Lx30SSGMZP7GZCq8g@mail.gmail.com>
References: <CAN7WH3+HdpkMwXMJGuFCn6FHUZAqxtFo4Lx30SSGMZP7GZCq8g@mail.gmail.com>

On 1/29/22 17:15, Yudianto Prasetyo wrote:
> Hello,
>
> 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?
>
> I'm sorry if it says comparing with Oracle DB, but in essence I'm just 
> looking for a solution to the problem above.
>
> Thank You
> Yours faithfully
>
>
> Yudianto

Number one, Postgres tables are files. Tablespaces are directories which 
reside in file systems, In Oracle, tables are sets of blocks within data 
files that tablespace is comprised of. That is a profound difference. In 
Oracle, we are using direct IO to bypass the OS cache and only use SGA 
("System Global Area") for caching data blocks. In Postgres, we are 
caching blocks from the files in OS cache which is essentially the free 
memory.

When translated to Postgres, your question reads: how to add space to 
file system? That depends on the file system and volume manager. If 
you're using brtfs or zfs (hopefully not) then your file sysems are also 
volume managers, If you're using LVM with xfs (my combination), then you 
can add space to your volume and extend the xfs file system. I have also 
tried using Oracle ASM as volume manager and use ACFS as the file 
system. The result was very nice, roughly the same as with LVM. However, 
the installation of ASM is rather complex and since PostgreSQL cannot be 
clustered, there is no justification for doing that.

-- 
Mladen Gogala
Database Consultant
Tel: (347) 321-1217
https://dbwhisperer.wordpress.com

view thread (14+ messages)  latest in thread

Message-ID: <1f8c76b8-779f-7ea7-52e1-3a48cdfc678c@gmail.com>
Permalink:  ../1f8c76b8-779f-7ea7-52e1-3a48cdfc678c@gmail.com/
Also on:    postgresql.org/message-id/1f8c76b8-779f-7ea7-52e1-3a48cdfc678c@gmail.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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: gogala.mladen@gmail.com
  Subject: Re: what is the solution like oracle DB's datafile
  In-Reply-To: <1f8c76b8-779f-7ea7-52e1-3a48cdfc678c@gmail.com>
  References: <CAN7WH3+HdpkMwXMJGuFCn6FHUZAqxtFo4Lx30SSGMZP7GZCq8g@mail.gmail.com> <1f8c76b8-779f-7ea7-52e1-3a48cdfc678c@gmail.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