Tell me more ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

The postgreSQL database file is stored in quite an obscure location by default:

/var/lib/postgresql/[version]/data/

I was hoping to put it in a more unified place for organisation purposes. I was wondering where people might recommend that I store it. For example, would something like this be good:

/var/db/ 

or perhaps

/var/www/sql/
share|improve this question

closed as not constructive by Nifle, Indrek, Renan, DragonLord, BBlake Oct 8 '12 at 17:59

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or specific expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, see the FAQ for guidance.

1 Answer

The location can be changed while launching the server providing the -D option:

postgres -D /some/other/directory

Or you can change the configuration option data_directory in the configuration file postgresql.conf

share|improve this answer
Great thank you. Where is a suitable please to relocate it to though, based on my suggestions above? – James Willson Oct 8 '12 at 11:54

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