Re: Separating Databases on Different Partitions

From: "Andy Shellam" <andy(dot)shellam(at)mailnetwork(dot)co(dot)uk>
To: <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Separating Databases on Different Partitions
Date: 2006-05-30 15:28:43
Message-ID: !~!UENERkVCMDkAAQACAAAAAAAAAAAAAAAAAC4AAAAAAAAAt+qV6pqKPEmXG74TlFgX5gEAlpDSN+DrMEWnumhoRHpQKQAAAbLc9wAAEAAAAJ4LePsW+XZOvyeG1ksiPa8BAAAAAA==@mailnetwork.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Hi Aaron

I believe you could probably do this best with table spaces. You'll have to
look it up in the documentation as I haven't done it for a while.

You symlink a directory under <pgdata>/pg_tblspc to another physical
directory (eg. Your user's home/db directory), then when you create the
database, set its default table space to which directory you create.

There is a downside in that the user could create a new table and override
the table space to that of another user.

You could always query the system catalogues for the usage for each user's
database and add that to the physical size of their home directory?

Regards,

Andy

_____

From: pgsql-admin-owner(at)postgresql(dot)org
[mailto:pgsql-admin-owner(at)postgresql(dot)org] On Behalf Of Aaron Bono
Sent: 30 May 2006 4:11 pm
To: pgsql-admin(at)postgresql(dot)org
Subject: [ADMIN] Separating Databases on Different Partitions

Is there a way to get Postgres to store each database in a separate
directory? I first hoped I could just use symbolic links under the data
directory but I have no idea which files are assigned to which database.

The reason I am wanting to do this is that I have a database set up for each
user on my server. I need to put their database under their home directory
somewhere so I know how much disk space each user account is taking. I also
need to put the database under the /home partition as it has a lot more
space than the partition containing the data directory.

Thanks,
Aaron

!DSPAM:14,447c60ea34499754912401!

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Tom Lane 2006-05-30 15:29:20 Re: Problem building initdb on sparc10
Previous Message Aaron Bono 2006-05-30 15:11:03 Separating Databases on Different Partitions