diff --git a/src/backend/catalog/Catalog.pm b/src/backend/catalog/Catalog.pm index 3b6a723faa64bc0e2fd4db2bb45f9c297225833c..6a2c13d771459507bc6f9099c360f7d3091e49ae 100644 --- a/src/backend/catalog/Catalog.pm +++ b/src/backend/catalog/Catalog.pm @@ -7,7 +7,7 @@ # Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group # Portions Copyright (c) 1994, Regents of the University of California # -# $PostgreSQL: pgsql/src/backend/catalog/Catalog.pm,v 1.1 2010/01/05 01:06:56 tgl Exp $ +# $PostgreSQL: pgsql/src/backend/catalog/Catalog.pm,v 1.2 2010/01/05 02:34:03 tgl Exp $ # #---------------------------------------------------------------------- @@ -169,31 +169,12 @@ sub Catalogs return \%catalogs; } -# Rename temporary files to final names, if anything has changed. +# Rename temporary files to final names. # Call this function with the final file name --- we append .tmp automatically sub RenameTempFile { my $final_name = shift; my $temp_name = $final_name . '.tmp'; - if (-e $final_name && -s $temp_name == -s $final_name) - { - open TN, '<', "$temp_name" || die "$temp_name: $!"; - if (open FN, '<', $final_name) - { - local $/ = undef; - my $tn = <TN>; - my $fn = <FN>; - close FN; - if ($tn eq $fn) - { - print "$final_name unchanged, not replacing\n"; - close TN; - unlink($temp_name) || die "unlink: $temp_name: $!"; - return; - } - } - close TN; - } print "Writing $final_name\n"; rename($temp_name, $final_name) || die "rename: $temp_name: $!"; } diff --git a/src/backend/catalog/genbki.pl b/src/backend/catalog/genbki.pl index 2020aeeb208dca629334e7f8a91eb9f89bfd94b7..e7660cea61c6ea0f0c6e9a4836f5c07aff813811 100644 --- a/src/backend/catalog/genbki.pl +++ b/src/backend/catalog/genbki.pl @@ -10,7 +10,7 @@ # Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group # Portions Copyright (c) 1994, Regents of the University of California # -# $PostgreSQL: pgsql/src/backend/catalog/genbki.pl,v 1.1 2010/01/05 01:06:56 tgl Exp $ +# $PostgreSQL: pgsql/src/backend/catalog/genbki.pl,v 1.2 2010/01/05 02:34:03 tgl Exp $ # #---------------------------------------------------------------------- @@ -287,7 +287,7 @@ close DESCR; close SHDESCR; close SCHEMAPG; -# Rename temp files on top of final files, if they have changed +# Finally, rename the completed files into place. Catalog::RenameTempFile($output_path . 'postgres.bki'); Catalog::RenameTempFile($output_path . 'postgres.description'); Catalog::RenameTempFile($output_path . 'postgres.shdescription');