pg_upgrade: Fix exec_prog API to be less flaky
Alvaro Herrera <alvherre@alvh.no-ip.org>
pg_upgrade: Fix exec_prog API to be less flaky The previous signature made it very easy to pass something other than the printf-format specifier in the corresponding position, without any warning from the compiler. While at it, move some of the escaping, redirecting and quoting responsibilities from the callers into exec_prog() itself. This makes the callsites cleaner.
Files
| Path | Change | +/− |
|---|---|---|
| contrib/pg_upgrade/check.c | modified | +3 −6 |
| contrib/pg_upgrade/dump.c | modified | +4 −5 |
| contrib/pg_upgrade/exec.c | modified | +42 −38 |
| contrib/pg_upgrade/pg_upgrade.c | modified | +26 −42 |
| contrib/pg_upgrade/pg_upgrade.h | modified | +5 −4 |
| contrib/pg_upgrade/server.c | modified | +16 −18 |