diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2002-01-15 22:33:20 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2002-01-15 22:33:20 +0000 |
commit | d66b10833fc4ea62a84ec715e5a38f3b2bb549d3 (patch) | |
tree | 0ab70c962b2a3715158fba3629d5f9c7792925a1 /src/backend/utils/cache/relcache.c | |
parent | aa00e6134e4fa892a2ec5f343d2c60a599dd29d9 (diff) | |
download | postgresql-d66b10833fc4ea62a84ec715e5a38f3b2bb549d3.tar.gz postgresql-d66b10833fc4ea62a84ec715e5a38f3b2bb549d3.zip |
If we fail to rename pg_internal.init into place, delete the useless
temporary file. This seems to be a known failure mode under Cygwin,
so we might as well expend the extra line of code to be tidy.
Diffstat (limited to 'src/backend/utils/cache/relcache.c')
-rw-r--r-- | src/backend/utils/cache/relcache.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/backend/utils/cache/relcache.c b/src/backend/utils/cache/relcache.c index 7eab8d73332..30542202407 100644 --- a/src/backend/utils/cache/relcache.c +++ b/src/backend/utils/cache/relcache.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.149 2001/11/05 17:46:30 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.150 2002/01/15 22:33:20 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -2978,5 +2978,12 @@ write_irels(void) * previously-existing init file. */ if (rename(tempfilename, finalfilename) < 0) + { elog(NOTICE, "Cannot rename init file %s to %s: %m\n\tContinuing anyway, but there's something wrong.", tempfilename, finalfilename); + /* + * If we fail, try to clean up the useless temp file; don't bother + * to complain if this fails too. + */ + unlink(tempfilename); + } } |