running postgresql database from loopback filesystem?

Started by Jeff Davisabout 22 years ago2 messagesgeneral
Jump to latest
#1Jeff Davis
pgsql@j-davis.com

I have virtual hosted users on a server and some of them have a
postgresql database. I'm concerned about the outside possibility that a
user could create an infinite loop and fill up the partition on which
everyone's database resides.

Anyway, it occured to me that I could create a special file for each
database user of limited size, and make a filesystem on top of that
file. The file could be owned by the user. Then, each user could have a
seperate database and that database would be at the location of the
mountpoint of that filesystem.

It seems like a strange thing to do (an understatement, to be sure), but
is there anything wrong with it? Are there performance considerations
when using loopback devices like that? Are there dangers of corruption?
How does journaling (ext3, reiser, etc) work in that regard?

Regards,
Jeff Davis

#2Bruce Momjian
bruce@momjian.us
In reply to: Jeff Davis (#1)
Re: running postgresql database from loopback filesystem?

Jeff Davis <jdavis-pgsql@empires.org> writes:

I have virtual hosted users on a server and some of them have a
postgresql database. I'm concerned about the outside possibility that a
user could create an infinite loop and fill up the partition on which
everyone's database resides.

It seems like the obvious solution would be quotas. You would have to set up
each database as a separate postgres postmaster running under a different uid
though.

--
greg