1
0
mirror of https://github.com/postgres/postgres.git synced 2025-08-28 18:48:04 +03:00

pg_upgrade: fix CopyFile() on Windows to fail on file existence

Also fix getErrorText() to return the right error string on failure.
This behavior now matches that of other operating systems.

Report by Noah Misch

Backpatch through 9.1
This commit is contained in:
Bruce Momjian
2015-11-24 17:18:28 -05:00
parent b542d940c3
commit b17dbf2629
12 changed files with 28 additions and 31 deletions

View File

@@ -214,7 +214,7 @@ check_loadable_libraries(void)
if (script == NULL && (script = fopen_priv(output_path, "w")) == NULL)
pg_fatal("Could not open file \"%s\": %s\n",
output_path, getErrorText(errno));
output_path, getErrorText());
fprintf(script, "Could not load library \"%s\"\n%s\n",
lib,
PQerrorMessage(conn));