Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to create an osm tileserver and am at the point where i've created the database to hold the output of osm2pgsql. But I can find neither the database (map_data) nor, of course, its tables. I need to softlink (ln -s) the tables to at least one other spindle, which has nearly a full TB of space open. I look in pgsql/data/base and see a lot of subtrees with numeric names. Presumably one of them is my map_data, but I can't find a name:number mapping table.

I'm used to MariaDB/MySQL, which seems much more straightforward to me.

share|improve this question
Just FYI, the name/number mapping is SELECT pg_relation_filepath('relname_or_oid') and is done via pg_class's. relfilenode attribute, plus the tablespace path. Never, ever, EVER mess with files in the database directory directly, though. – Craig Ringer Dec 30 '13 at 1:24

Don't mess with the data files in the filesystem it's a sure way to get your database corrupted.

You can achieve what you want, by creating a tablespace and then move the table to the new tablespace:

create tablespace big_one LOCATION '/path/to/other/spindle';
alter table map_data set tablespace big_one;

Btw: MySQL isn't "more straightforward" - it's just different. And I could list several things that are much more "straightforward" in Postgres than in MySQL

share|improve this answer
... and remember, it's not safe to put a tablespace of "less important" stuff on a less reliable disk. Unfortunately the way Pg's tablespace support is designed, your database is just as stuffed if an unimportant tablespace goes away unexpectedly. – Craig Ringer Dec 30 '13 at 1:26
I'm aware that to say thanks in comments violates convention here but not saying thanks at all doesn't work for me, so: Thank you, horse and Craig. I don't have enough mojo yet to uptick your responses, so this is the best I can do. – MMacD Dec 30 '13 at 11:37

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.