0

I installed postgres 9.5 quite a while ago, and since a few months ago have upgraded to 9.6 and used that. Recently I shut down my computer and restarted postgres, but when I connect to the 9.6 server and run

SHOW data_directory

it is showing that my data directory is under the 9.5 folder. As a result, none of my recent databases are available because I am linked to the old version of postgres. What happened and how can I change it back?

enter image description here

1 Answer 1

1

It would seem that your machine has started your previous instance. You need to stop the 9.5 server and start the 9.6.

On *nix OS you will need to use the PG_CTL command. eg:

PG_CTL -D [enter path for 9.5 data directory here] stop
PG_CTL -D [enter path for 9.6 data directory here] start

This should stop 9.5 and start 9.6. You can confirm this by doing:

PG_CTL -D [enter path for 9.5 data directory here] status

should return stopped.

PG_CTL -D [enter path for 9.6 data directory here] status

should return running.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.