Data folder in differnet filesystem

Started by S Arvindover 16 years ago5 messagesgeneral
Jump to latest
#1S Arvind
arvindwill@gmail.com

I have 2 doubts related to Filsesytem and Postgres data folder

1.Currently in CentOS, our postgres data folder is in single filesystem. Is
there any possibility to have a single data folder of single postgres in
more then one file system.
2.I am having three big DB, is it possible to have a data of each DB in
different file system. so if i want to add a DB to postgre i will mount a
drive (filesystem ) and point that location for the postgres to use that
space.
for eg
Filesystem Mounted on
/dev/hda3 /data/db1 for DB1
/dev/hda4 /data/db2 for DB2

thanks in advance

Arvind S

"Many of lifes failure are people who did not realize how close they were to
success when they gave up."
-Thomas Edison

#2A. Kretschmer
andreas.kretschmer@schollglas.com
In reply to: S Arvind (#1)
Re: Data folder in differnet filesystem

In response to S Arvind :

I have 2 doubts related to Filsesytem and Postgres data folder

1.Currently in CentOS,� our postgres data folder is in single filesystem. Is
there any possibility to have a single data folder of single postgres in more
then one file system.

Don't understand ...

2.I am having three big DB, is it possible to have a data of each DB in
different file system. so if i want to add a DB to postgre i will mount a drive
(filesystem ) and point that location for the postgres to use that space.
� for eg
Filesystem Mounted on
/dev/hda3����� /data/db1 ���������� for DB1
/dev/hda4����� /data/db2����������� for DB2

Sure, use different tablespaces.

http://www.postgresql.org/docs/8.4/static/manage-ag-tablespaces.html

Andreas
--
Andreas Kretschmer
Kontakt: Heynitz: 035242/47150, D1: 0160/7141639 (mehr: -> Header)

#3Jasen Betts
jasen@xnet.co.nz
In reply to: S Arvind (#1)
Re: Data folder in differnet filesystem

On 2009-09-03, S Arvind <arvindwill@gmail.com> wrote:

--001636ed7465170dcf0472ab404d
Content-Type: text/plain; charset=ISO-8859-1

I have 2 doubts related to Filsesytem and Postgres data folder

1.Currently in CentOS, our postgres data folder is in single filesystem. Is
there any possibility to have a single data folder of single postgres in
more then one file system.
2.I am having three big DB, is it possible to have a data of each DB in
different file system. so if i want to add a DB to postgre i will mount a
drive (filesystem ) and point that location for the postgres to use that
space.
for eg
Filesystem Mounted on
/dev/hda3 /data/db1 for DB1
/dev/hda4 /data/db2 for DB2

to be able to mount and unmount databases you will need to use
separate "clusters",

#4Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Jasen Betts (#3)
Re: Data folder in differnet filesystem

Jasen Betts wrote:

On 2009-09-03, S Arvind <arvindwill@gmail.com> wrote:

--001636ed7465170dcf0472ab404d
Content-Type: text/plain; charset=ISO-8859-1

I have 2 doubts related to Filsesytem and Postgres data folder

1.Currently in CentOS, our postgres data folder is in single filesystem. Is
there any possibility to have a single data folder of single postgres in
more then one file system.
2.I am having three big DB, is it possible to have a data of each DB in
different file system. so if i want to add a DB to postgre i will mount a
drive (filesystem ) and point that location for the postgres to use that
space.
for eg
Filesystem Mounted on
/dev/hda3 /data/db1 for DB1
/dev/hda4 /data/db2 for DB2

to be able to mount and unmount databases you will need to use
separate "clusters",

No, you can also use tablespaces for this. Just create a directory
inside /data/db1 (say /data/db1/ts) and then CREATE TABLESPACE ts_for_db1
LOCATION '/data/db1/ts'. Then you can create the database in there.

--
Alvaro Herrera http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

#5Jasen Betts
jasen@xnet.co.nz
In reply to: S Arvind (#1)
Re: Data folder in differnet filesystem

On 2009-09-07, Alvaro Herrera <alvherre@commandprompt.com> wrote:

Jasen Betts wrote:

On 2009-09-03, S Arvind <arvindwill@gmail.com> wrote:

--001636ed7465170dcf0472ab404d
Content-Type: text/plain; charset=ISO-8859-1

I have 2 doubts related to Filsesytem and Postgres data folder

1.Currently in CentOS, our postgres data folder is in single filesystem. Is
there any possibility to have a single data folder of single postgres in
more then one file system.
2.I am having three big DB, is it possible to have a data of each DB in
different file system. so if i want to add a DB to postgre i will mount a
drive (filesystem ) and point that location for the postgres to use that
space.
for eg
Filesystem Mounted on
/dev/hda3 /data/db1 for DB1
/dev/hda4 /data/db2 for DB2

to be able to mount and unmount databases you will need to use
separate "clusters",

No, you can also use tablespaces for this. Just create a directory
inside /data/db1 (say /data/db1/ts) and then CREATE TABLESPACE ts_for_db1
LOCATION '/data/db1/ts'. Then you can create the database in there.

If later disks aren't present you will not be able to do many things
(like add or remove roles)

True. S. did not ask for that feature explicily (only about adding databases)