I followed these instructions to move Postgres data directory from C:\Users\username\Documents\dir\postgres96_data to C:\Users\username\Documents\postgres96_data.
Now the Postgres service won't start. Trying to start it manually yields the following message (freely translated from pt-br):
"The postgres-x64-9.6 service on Local Computer started then stopped. Some services stop automatically if they are not beeing used by other services or programs."
I tried (successfully) to start the database in cmd.exe, with the command
"C:\Program Files\PostgreSQL\9.6\bin\pg_ctl.exe" start -D "C:\Users\username\Documents\postgres96_data" -w
The log was:
2017-02-20 07:33:26 BRT LOG: database system was interrupted; last known up at 2017-02-18 09:52:00 BRT
2017-02-20 07:33:27 BRT FATAL: the database system is starting up
...
2017-02-20 07:35:10 BRT FATAL: the database system is starting up
2017-02-20 07:36:19 BRT LOG: database system was not properly shut down; automatic recovery in progress
2017-02-20 07:36:19 BRT LOG: invalid record length at 6/438EBB88: wanted 24, got 0
2017-02-20 07:36:19 BRT LOG: redo is not required
2017-02-20 07:36:19 BRT LOG: MultiXact member wraparound protections are now enabled
2017-02-20 07:36:19 BRT LOG: sistema de banco de dados está pronto para aceitar conexões [database system is ready to accept conections, free translation]
2017-02-20 07:36:21 BRT LOG: autovacuum launcher started
PREVIOUS RESEARCH