2

Wow! I seem to be stuck in the 9th level of pg wrapper command hell...

On Debian, have been trying to delete cluster 'main' (in order to recreate using appropriate locales and other options...)

After a bit of futzing, am getting these responses from wrapper tools:

$ pg_createcluster 9.4 main Error: cluster configuration already
exists

( seems reasonable - it does! )

$ pg_dropcluster 9.4 main Error: Invalid data directory

OK, but which data directory? The 'main' cluster dir is there, intact - correct permissions...

What do these tools read to get these configurations?

How to drop 'main' and start afresh?

2
  • 2
    It reads the configuration file: /etc/postgresql/9.4/main/postgresql.conf. If you have deleted that, finish the manual delete by removing the datadir. Commented Apr 3, 2017 at 18:20
  • 1
    If you want to start from scratch anyway, you could remove all postgresql packages with dpkg or aptitude and then just re-install what you need. Also tip for finding what files a command will open: prefix it with strace -e open. It will create a lot of lines on output but you will see each file your command opens and with related errors. Commented Mar 8, 2018 at 20:12

1 Answer 1

0

After Daniel Vérité, often these unexpected Debian PostgreSQL tools results derive from leftover directories. One would want to remove all relevant /etc/postgresql/<version>/<cluster> & /var/lib/postgresql/<version>/<cluster> subdirectories before trying again.

Your Answer

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

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