OpenStreetMap postgresql postGIS database on RAID

rweait's picture

Configure a database for OpenStreetMap on another disk

Perhaps you need more space for your OpenStreetMap database and decide to move it to your shiny new big disk or RAID array? Sound good? Here we go. We need to create a tablespace for the database, then use it.

Create a directory for the database
sudo mkdir /raid/newgis
sudo chown postgres:postgres /raid/newgis

As the postgres user
sudo -u postgres -i

Create a user for this database. Perhaps replace username with your username? Sure.
createuser username # answer yes for superuser

Create a tablespace for the new database. This is where the database tables will be stored.
echo "create tablespace newgist location '/raid/newgis';" | psql

Create the database with the -D tablespace option.
createdb -D newgist -E UTF8 -O username newgis

Continue configuring the database as usual. When imported, the database will be stored in /raid/newgis, rather than the default location.

Resources

This article was originally published on Fri, 03/26/2010 - 21:26.

Add new comment

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
14 + 4 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.