I wrote: > Patrik Novotny <panov...@redhat.com> writes: >> thanks for you reply. You're right, and I apologise for the confusion. >> Options I was talking about are specified via the `--old-options` >> parameter of the pg_upgrade (ex.: --old-options '-c >> unix_socket_directories=/run') >> Mentioning of the environment variable came only from my own >> confusion. I also attached the mentioned patch.
> Ah, now I see what you're on about. I agree that this is a good > change ... and we probably should add a comment reminding people > to keep the user options at the end, because somebody[1] broke this > through add-at-the-end syndrome. Actually ... now that I look more carefully, I'm not sure this change would improve matters. You can't just reach in and select a different socket directory behind pg_upgrade's back; if you try, the connection attempts later are going to fail, because pg_upgrade will be telling pg_dump to use what it thinks the socket directory is. You might be better off back-patching the addition of the --socketdir option (commit 2d34ad84303181111c6f0747186857ff50106267). regards, tom lane