1. 31 Mar, 2008 4 commits
    • Tom Lane's avatar
      Apply my original fix for Taiki Yamaguchi's bug report about DISTINCT MAX(). · d3441155
      Tom Lane authored
      Add some regression tests for plausible failures in this area.
      d3441155
    • Tom Lane's avatar
      Fix my brain fade in TRUNCATE triggers patch: can't release relcache refcounts · e86237ff
      Tom Lane authored
      while EState still contains pointers to those relations.  Exposed by the
      CLOBBER_CACHE_ALWAYS tests that buildfarm member jaguar is running (I knew
      those cycles would pay off...)
      e86237ff
    • Tom Lane's avatar
      Use error message wordings for permissions checks on .pgpass and SSL private · 3405f2b9
      Tom Lane authored
      key files that are similar to the one for the postmaster's data directory
      permissions check.  (I chose to standardize on that one since it's the most
      heavily used and presumably best-wordsmithed by now.)  Also eliminate explicit
      tests on file ownership in these places, since the ensuing read attempt must
      fail anyway if it's wrong, and there seems no value in issuing the same error
      message for distinct problems.  (But I left in the explicit ownership test in
      postmaster.c, since it had its own error message anyway.)  Also be more
      specific in the documentation's descriptions of these checks.  Per a gripe
      from Kevin Hunter.
      3405f2b9
    • 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
  2. 30 Mar, 2008 3 commits
  3. 29 Mar, 2008 3 commits
  4. 28 Mar, 2008 6 commits
  5. 27 Mar, 2008 7 commits
  6. 26 Mar, 2008 10 commits
  7. 25 Mar, 2008 7 commits
    • Neil Conway's avatar
    • Tom Lane's avatar
      Simplify and standardize conversions between TEXT datums and ordinary C · 220db7cc
      Tom Lane authored
      strings.  This patch introduces four support functions cstring_to_text,
      cstring_to_text_with_len, text_to_cstring, and text_to_cstring_buffer, and
      two macros CStringGetTextDatum and TextDatumGetCString.  A number of
      existing macros that provided variants on these themes were removed.
      
      Most of the places that need to make such conversions now require just one
      function or macro call, in place of the multiple notational layers that used
      to be needed.  There are no longer any direct calls of textout or textin,
      and we got most of the places that were using handmade conversions via
      memcpy (there may be a few still lurking, though).
      
      This commit doesn't make any serious effort to eliminate transient memory
      leaks caused by detoasting toasted text objects before they reach
      text_to_cstring.  We changed PG_GETARG_TEXT_P to PG_GETARG_TEXT_PP in a few
      places where it was easy, but much more could be done.
      
      Brendan Jurd and Tom Lane
      220db7cc
    • Bruce Momjian's avatar
      Done: · f948197b
      Bruce Momjian authored
      > * -Avoid tuple some tuple copying in sort routines
      f948197b
    • Neil Conway's avatar
      Add a new tuplestore API function, tuplestore_putvalues(). This is · 1d812a98
      Neil Conway authored
      identical to tuplestore_puttuple(), except it operates on arrays of
      Datums + nulls rather than a fully-formed HeapTuple. In several places
      that use the tuplestore API, this means we can avoid creating a
      HeapTuple altogether, saving a copy.
      1d812a98
    • Bruce Momjian's avatar
      Update TODO wording: · 76cf067a
      Bruce Momjian authored
      	* Simplify integer cross-data-type operators
      76cf067a
    • Alvaro Herrera's avatar
      Reword Win32 rint() item, per Tom. · ab20a846
      Alvaro Herrera authored
      ab20a846
    • Alvaro Herrera's avatar
      7726f6f3