Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2014
    Posts
    1

    Question Unanswered: How to change the postgresql data directory location database wise ?

    Hi all,

    This is my 1st post in dbforum, hope i will get a reply fast.
    I am using OpenERP with postgresql 9.2 as the backend RDBMS.
    I have 2 databases in my machine and i wish to store the data of the corresponding databases in two different data directory locations. ?
    If yes can some one let me know how ?

    I see an article speaks about how to change the data directory location but its outside the database level.

    So is there any one to help me out here ? would be great for that

    Thanks in advance
    Muthunaveen

  2. #2
    Join Date
    Dec 2007
    Posts
    253
    This is an Oracle forum. Try a postgresql forum

  3. #3
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    I've moved your thread from the Oracle forum to the PostgreSQL forum. It should have a better chance of getting an appropriate answer here.

    -PatP
    In theory, theory and practice are identical. In practice, theory and practice are unrelated.

  4. #4
    Join Date
    Mar 2014
    Posts
    20
    This is fairly easy to do, at least on Linux systems, but I've not tried it on Windows servers. If you look in your /etc/init.d directory, you should find the service control script which starts, stops, reloads, etc. you postgresql instance. Make a copy of that with a different name. Inside the copy, find your PGPORT, PGDATA, and PGLOG environment variables and change those to other values. You'll have to use a different port and data directory at the very least. After you're done editing, run chkconfig so this instance starts automatically. Syntax for that is your homework.

    Once you've started the new instance, you should be able to connect with psql by giving it the proper parameters. If you have applications which need to connect with this instance, the connection string or method must change to connect with the right port.

    Have fun,
    Jay

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •