Skip to content
Snippets Groups Projects
  1. Dec 27, 2009
  2. Nov 14, 2009
  3. Nov 12, 2009
    • Tom Lane's avatar
      Check for C/POSIX before assuming that nl_langinfo or win32_langinfo · 8539a0e0
      Tom Lane authored
      will work.  Per buildfarm results.
      8539a0e0
    • Tom Lane's avatar
      Make initdb behave sanely when the selected locale has codeset "US-ASCII". · 8f8a5df6
      Tom Lane authored
      Per discussion, this should result in defaulting to SQL_ASCII encoding.
      The original coding could not support that because it conflated selection
      of SQL_ASCII encoding with not being able to determine the encoding.
      Adjust pg_get_encoding_from_locale()'s API to distinguish these cases,
      and fix callers appropriately.  Only initdb actually changes behavior,
      since the other callers were perfectly content to consider these cases
      equivalent.
      
      Per bug #5178 from Boh Yap.  Not going to bother back-patching, since
      no one has complained before and there's an easy workaround (namely,
      specify the encoding you want).
      8f8a5df6
  4. Sep 13, 2009
    • Heikki Linnakangas's avatar
      Don't error out if recycling or removing an old WAL segment fails at the end · 7f2a10fe
      Heikki Linnakangas authored
      of checkpoint. Although the checkpoint has been written to WAL at that point
      already, so that all data is safe, and we'll retry removing the WAL segment at
      the next checkpoint, if such a failure persists we won't be able to remove any
      other old WAL segments either and will eventually run out of disk space. It's
      better to treat the failure as non-fatal, and move on to clean any other WAL
      segment and continue with any other end-of-checkpoint cleanup.
      
      We don't normally expect any such failures, but on Windows it can happen with
      some anti-virus or backup software that lock files without FILE_SHARE_DELETE
      flag.
      
      Also, the loop in pgrename() to retry when the file is locked was broken. If a
      file is locked on Windows, you get ERROR_SHARE_VIOLATION, not
      ERROR_ACCESS_DENIED, at least on modern versions. Fix that, although I left
      the check for ERROR_ACCESS_DENIED in there as well (presumably it was correct
      in some environment), and added ERROR_LOCK_VIOLATION to be consistent with
      similar checks in pgwin32_open(). Reduce the timeout on the loop from 30s to
      10s, on the grounds that since it's been broken, we've effectively had a
      timeout of 0s and no-one has complained, so a smaller timeout is actually
      closer to the old behavior. A longer timeout would mean that if recycling a
      WAL file fails because it's locked for some reason, InstallXLogFileSegment()
      will hold ControlFileLock for longer, potentially blocking other backends, so
      a long timeout isn't totally harmless.
      
      While we're at it, set errno correctly in pgrename().
      
      Backpatch to 8.2, which is the oldest version supported on Windows. The xlog.c
      changes would make sense on other platforms and thus on older versions as
      well, but since there's no such locking issues on other platforms, it's not
      worth it.
      7f2a10fe
  5. Aug 27, 2009
    • Peter Eisentraut's avatar
      Update of install-sh, mkinstalldirs, and associated configury · 9d182ef0
      Peter Eisentraut authored
      Update install-sh to that from Autoconf 2.63, plus our Darwin-specific
      changes (which I simplified a bit).  install-sh is now able to install
      multiple files in one run, so we could simplify our makefiles sometime.
      
      install-sh also now has a -d option to create directories, so we don't need
      mkinstalldirs anymore.
      
      Use AC_PROG_MKDIR_P in configure.in, so we can use mkdir -p when available
      instead of install-sh -d.  For consistency with the rest of the world,
      the corresponding make variable has been renamed from $(mkinstalldirs) to
      $(MKDIR_P).
      9d182ef0
  6. Jul 27, 2009
  7. Jul 16, 2009
    • Tom Lane's avatar
      Add erand48() to the set of functions supported by our src/port/ library, · c43feefa
      Tom Lane authored
      and extend configure to test for it properly instead of hard-wiring
      an assumption that everybody but Windows has the rand48 functions.
      (We do cheat to the extent of assuming that probing for erand48 will do
      for the entire rand48 family.)
      
      erand48() is unused as of this commit, but a followon patch will cause
      GEQO to depend on it.
      
      Andres Freund, additional hacking by Tom
      c43feefa
  8. Jul 02, 2009
  9. Jun 11, 2009
  10. May 04, 2009
  11. Apr 05, 2009
  12. Apr 04, 2009
  13. Apr 03, 2009
    • Magnus Hagander's avatar
      Make directory name comparisons on Win32 case insensitive. · aa38153d
      Magnus Hagander authored
      This method will not catch all different ways since the locale
      handling in NTFS doesn't provide an easy way to do that, but it
      will hopefully solve the most common cases causing startup
      problems when the backend is found in the system PATH.
      
      Attempts to fix bug #4694.
      aa38153d
  14. Feb 15, 2009
  15. Feb 12, 2009
  16. Feb 10, 2009
  17. Jan 21, 2009
    • Magnus Hagander's avatar
      Make win32 builds always do SetEnvironmentVariable() when doing putenv(). · 01543450
      Magnus Hagander authored
      Also, if linked against other versions than the default MSVCRT library
      (for example the MSVC build which links against MSVCRT80), also update
      the cache in the default MSVCRT at the same time.
      
      This should fix the issues with setting LC_MESSAGES on the MSVC build.
      
      Original patch from Hiroshi Inoue and Hiroshi Saito, much rewritten
      by me.
      01543450
  18. Jan 14, 2009
  19. Jan 01, 2009
  20. Dec 11, 2008
  21. Dec 02, 2008
  22. Nov 25, 2008
  23. Nov 24, 2008
  24. Oct 16, 2008
  25. May 21, 2008
  26. May 17, 2008
    • Andrew Dunstan's avatar
      Add $PostgreSQL$ markers to a lot of files that were missing them. · 53972b46
      Andrew Dunstan authored
      This particular batch was just for *.c and *.h file.
      
      The changes were made with the following 2 commands:
      
      find . \( \( -name 'libstemmer' -o -name 'expected' -o -name 'ppport.h' \) -prune \) -o  \( -name '*.[ch]'  \) \( -exec grep -q '\$PostgreSQL' {} \; -o -print \) | while read file ; do head -n 1 < $file | grep -q '^/\*' && echo $file; done | xargs -l sed -i -e '1s/^\// /' -e '1i/*\n * $PostgreSQL:$ \n *'
      
      find . \( \( -name 'libstemmer' -o -name 'expected' -o -name 'ppport.h' \) -prune \) -o  \( -name '*.[ch]'  \) \( -exec grep -q '\$PostgreSQL' {} \; -o -print \) | xargs -l sed -i -e '1i/*\n * $PostgreSQL:$ \n */'
      53972b46
    • Tom Lane's avatar
  27. May 14, 2008
  28. Apr 22, 2008
  29. Apr 18, 2008
    • Tom Lane's avatar
      Fix rmtree() so that it keeps going after failure to remove any individual · b8e5581d
      Tom Lane authored
      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.
      b8e5581d
    • Heikki Linnakangas's avatar
      Fix two race conditions between the pending unlink mechanism that was put in · 9cb91f90
      Heikki Linnakangas authored
      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.
      9cb91f90
  30. Apr 17, 2008
  31. Apr 12, 2008
  32. Apr 10, 2008
  33. Mar 31, 2008
    • Tom Lane's avatar
      Fix a number of places that were making file-type tests infelicitously. · c5f11f9d
      Tom Lane authored
      The places that did, eg,
      	(statbuf.st_mode & S_IFMT) == S_IFDIR
      were correct, but there is no good reason not to use S_ISDIR() instead,
      especially when that's what the other 90% of our code does.  The places
      that did, eg,
      	(statbuf.st_mode & S_IFDIR)
      were flat out *wrong* and would fail in various platform-specific ways,
      eg a symlink could be mistaken for a regular file on most Unixen.
      
      The actual impact of this is probably small, since the problem cases
      seem to always involve symlinks or sockets, which are unlikely to be
      found in the directories that PG code might be scanning.  But it's
      clearly trouble waiting to happen, so patch all the way back anyway.
      (There seem to be no occurrences of the mistake in 7.4.)
      c5f11f9d
  34. Mar 21, 2008
Loading