0

I'm trying to run pg_archivecleanup from our DR Postgres server (Windows), but I am getting return code 2. I am guessing that the issue may be permissions since I can run the command myself and it works fine, but the Postgres service logs return code 2 and does nothing. I'm hoping that there might be more information about the return code than the Postgres log provides ('archive location does not exist')

I have looked in the online and offline documentation and googled to try and get more information about what the return codes mean, but cannot find the information. I don't really want to have to read the code myself for it, as I am not a C developer and may miss some nuance of it's behaviour (even if it is well written enough that I can understand it).

Can anyone help point me towards a reference somewhere (that is apparently hidden from search engines!), or maybe even list the return codes and their meanings here?

1 Answers1

2

I'm not a C programmer either, but it doesn't take much to see in the code

http://doxygen.postgresql.org/pg__archivecleanup_8c_source.html

that return code 2 is used for many different failures. Search for exit(2). It looks like all of them print error messages to stderr.

Mark Berry
  • 273
  • 3
  • 18