summaryrefslogtreecommitdiff
path: root/src/port/dirmod.c
AgeCommit message (Collapse)Author
2009-01-01Update copyright for 2009.Bruce Momjian
2008-04-18Fix rmtree() so that it keeps going after failure to remove any individualTom Lane
file; the idea is that we should clean up as much as we can, even if there's some problem removing one file. Make the error messages a bit less misleading, too. In passing, const-ify function arguments.
2008-04-18Fix two race conditions between the pending unlink mechanism that was put inHeikki Linnakangas
place to prevent reusing relation OIDs before next checkpoint, and DROP DATABASE. First, if a database was dropped, bgwriter would still try to unlink the files that the rmtree() call by the DROP DATABASE command has already deleted, or is just about to delete. Second, if a database is dropped, and another database is created with the same OID, bgwriter would in the worst case delete a relation in the new database that happened to get the same OID as a dropped relation in the old database. To fix these race conditions: - make rmtree() ignore ENOENT errors. This fixes the 1st race condition. - make ForgetDatabaseFsyncRequests forget unlink requests as well. - force checkpoint on in dropdb on all platforms Since ForgetDatabaseFsyncRequests() is asynchronous, the 2nd change isn't enough on its own to fix the problem of dropping and creating a database with same OID, but forcing a checkpoint on DROP DATABASE makes it sufficient. Per Tom Lane's bug report and proposal. Backpatch to 8.3.
2008-04-11A quick try at un-breaking the Cygwin build. Whether it needs theTom Lane
pgwin32_safestat remains to be determined, but in any case the current code is not tolerable.
2008-04-10Create wrapper pgwin32_safestat() and redefine stat() to itMagnus Hagander
on win32, because the stat() function in the runtime cannot be trusted to always update the st_size field. Per report and research by Sergey Zubkovsky.
2008-01-01Update copyrights in source tree to 2008.Bruce Momjian
2007-11-15pgindent run for 8.3.Bruce Momjian
2007-07-25Rename DLLIMPORT macro to PGDLLIMPORT to avoid conflict withMagnus Hagander
third party includes (like tcl) that define DLLIMPORT.
2007-07-12Get dirmod.c on the same page as port.h about whether we use pgsymlinkTom Lane
on Cygwin (answer: we don't). Also try to unwind the #ifdef spaghetti a little bit. Untested but hopefully I didn't break anything.
2007-01-19Change the sed rules in the regression test for pg_regress hackery to createAlvaro Herrera
the generated files, to help Visual C++ to run these tests. The tests still pass in VPATH and normal builds. Patch from Magnus Hagander, editorialized by me.
2007-01-05Update CVS HEAD for 2007 copyright. Back branches are typically notBruce Momjian
back-stamped for this.
2006-12-04Patch of Win32 Encoding problem for server messages usingBruce Momjian
FormatMessage() (This should have been in 8.2.0, patched to 8.2.X and HEAD): I think this problem to be complex.... http://archives.postgresql.org/pgsql-hackers/2006-11/msg00042.php FormatMessage of windows cannot consider the encoding of the database. However, I should try the solution now. It is necessary to clear the problem. Multi character-code exists together in message and log. It doesn't consider the data base encoding that the user intended.... The user in multi-byte country can try this. http://inet.winpg.jp/~saito/pg_bug/MessageCheck.c That is, it is likely to become it in this manner.(Japanese) http://inet.winpg.jp/~saito/pg_bug/FormatMessage998.png Hiroshi Saito
2006-11-08Change Windows rename and unlink substitutes so that they time out afterTom Lane
30 seconds instead of retrying forever. Also modify xlog.c so that if it fails to rename an old xlog segment up to a future slot, it will unlink the segment instead. Per discussion of bug #2712, in which it became apparent that Windows can handle unlinking a file that's being held open, but not renaming it.
2006-07-18copydir() and rmtree() need to use lstat, not stat, to behave as expectedTom Lane
with symlinks. Noted while trying to use rmtree in new C-code pg_regress.
2006-03-05Update copyright for 2006. Update scripts.Bruce Momjian
2005-10-15Standard pgindent run for 8.1.Bruce Momjian
2005-09-18Clarify some error messagesPeter Eisentraut
2005-08-10Document why Win32 loops over rename/unlink are necessary.Bruce Momjian
2005-08-02rmtree() reported the wrong pathname if final rmdir failed.Tom Lane
2005-03-24Add missing error checking in readdir() loops.Tom Lane
2005-02-22Use _() macro consistently rather than gettext(). Add translationBruce Momjian
macros around strings that were missing them.
2005-02-13Print file name and errno string on rmtree failure.Bruce Momjian
Backpatch to 8.0.X.
2004-12-31Tag appropriate files for rc3PostgreSQL Daemon
Also performed an initial run through of upgrading our Copyright date to extend to 2005 ... first run here was very simple ... change everything where: grep 1996-2004 && the word 'Copyright' ... scanned through the generated list with 'less' first, and after, to make sure that I only picked up the right entries ...
2004-11-27Work around lack of NLS support in libpgport by making those componentsPeter Eisentraut
who use it scan the relevant source files for their own catalog. It creates a bit of duplicate work for translators, but it gets the job done for now.
2004-10-28Code cleanup in dirmod.c. Andrew Dunstan, some further mods by moi.Tom Lane
2004-10-18Remove use of "miscadmin.h" in port C files and remove test for frontendBruce Momjian
in miscadmin.h.
2004-10-17Better document win32_open and its ability to allow concurrentBruce Momjian
unlink/rename().
2004-10-17Fix some typos.Bruce Momjian
2004-10-11Use native Cygwin symlinks so tablespaces work on Win95/98/ME whichBruce Momjian
don't support junction points. Doesn't affect native Win32.
2004-09-27Remove inclusion of windows.h now that it is included in c.h, per ideaBruce Momjian
from Peter.
2004-09-10Add mention loops over unlink/rename might not be needed.Bruce Momjian
2004-09-10Move undef of rename/unlink so system declarations are unmodified.Bruce Momjian
2004-09-10Clean up Cygwin test.Bruce Momjian
2004-09-09Fix Cygwin defines to be consistent.Bruce Momjian
2004-08-29Pgindent run for 8.0.Bruce Momjian
2004-08-29Update copyright to 2004.Bruce Momjian
2004-08-29Several Cygwin fixes pointed out by Reini Urban.Bruce Momjian
2004-08-29Add comment on palloc use and DLLIMPORT>Bruce Momjian
2004-08-08Allow libpgport to call memory allocation routines even thoughBruce Momjian
CurrentMemoryContext is DLLIMPORT on Win32. Work around that by creating stubs in the backend for palloc/pstrdup. Also fix pg_dumpall to do proper quoting on Win32.
2004-08-08Adjust defines to be consistent.Bruce Momjian
2004-08-08Remove xstrdup and friends who were only called once. Replace withBruce Momjian
#ifdef calls.
2004-08-08Fixups for Win32 symlinks.Bruce Momjian
2004-08-07The attached patch implements a symlink for win32 using junctions, andBruce Momjian
uses that for win32 tablespaces. Andreas Pflug
2004-08-01Add docs for initdb --auth.Bruce Momjian
2004-02-26For immediate application to HEAD.Bruce Momjian
Corrects bit-rot of recently applied patch. win32/cygwin only. Claudio Natoli
2004-02-25For application to HEAD, following community review.Bruce Momjian
* Changes incorrect CYGWIN defines to __CYGWIN__ * Some localtime returns NULL checks (when unchecked cause SEGVs under Win32 regression tests) * Rationalized CreateSharedMemoryAndSemaphores and AttachSharedMemoryAndSemaphores (Bruce, I finally remembered to do it); requires attention. Claudio Natoli
2004-02-02Win32 adjustments for dirmod and configure/configure.in.Bruce Momjian
2004-02-02Adjust rename on Win32 to only link to temp name while holding lock,Bruce Momjian
then release locks and loop over renaming to active file name.
2003-11-29$Header: -> $PostgreSQL Changes ...PostgreSQL Daemon
2003-11-11Update /port C header descriptions.Bruce Momjian