1. 12 4月, 2008 2 次提交
    • T
      A quick try at un-breaking the Cygwin build. Whether it needs the · 0b7afedb
      Tom Lane 提交于
      pgwin32_safestat remains to be determined, but in any case the current
      code is not tolerable.
      0b7afedb
    • T
      Fix several datatype input functions that were allowing unused bytes in their · 56295419
      Tom Lane 提交于
      results to contain uninitialized, unpredictable values.  While this was okay
      as far as the datatypes themselves were concerned, it's a problem for the
      parser because occurrences of the "same" literal might not be recognized as
      equal by datumIsEqual (and hence not by equal()).  It seems sufficient to fix
      this in the input functions since the only critical use of equal() is in the
      parser's comparisons of ORDER BY and DISTINCT expressions.
      Per a trouble report from Marc Cousin.
      
      Patch all the way back.  Interestingly, array_in did not have the bug before
      8.2, which may explain why the issue went unnoticed for so long.
      56295419
  2. 11 4月, 2008 1 次提交
  3. 10 4月, 2008 1 次提交
  4. 09 4月, 2008 1 次提交
  5. 05 4月, 2008 1 次提交
    • T
      Defend against JOINs having more than 32K columns altogether. We cannot · 5e8146c7
      Tom Lane 提交于
      currently support this because we must be able to build Vars referencing
      join columns, and varattno is only 16 bits wide.  Perhaps this should be
      improved in future, but considering that it never came up before, I'm not
      sure the problem is worth much effort.  Per bug #4070 from Marcello
      Ceschia.
      
      The problem seems largely academic in 8.0 and 7.4, because they have
      (different) O(N^2) performance issues with such wide joins, but
      back-patch all the way anyway.
      5e8146c7
  6. 04 4月, 2008 1 次提交
    • T
      Teach ANALYZE to distinguish dead and in-doubt tuples, which it formerly · affdd52d
      Tom Lane 提交于
      classed all as "dead"; also get it to count DEAD item pointers as dead rows,
      instead of ignoring them as before.  Also improve matters so that tuples
      previously inserted or deleted by our own transaction are handled nicely:
      the stats collector's live-tuple and dead-tuple counts will end up correct
      after our transaction ends, regardless of whether we end in commit or abort.
      
      While there's more work that could be done to improve the counting of in-doubt
      tuples in both VACUUM and ANALYZE, this commit is enough to alleviate some
      known bad behaviors in 8.3; and the other stuff that's been discussed seems
      like research projects anyway.
      
      Pavan Deolasee and Tom Lane
      affdd52d
  7. 03 4月, 2008 2 次提交
    • P
    • T
      Revert my bad decision of about a year ago to make PortalDefineQuery · ab2071b5
      Tom Lane 提交于
      responsible for copying the query string into the new Portal.  Such copying
      is unnecessary in the common code path through exec_simple_query, and in
      this case it can be enormously expensive because the string might contain
      a large number of individual commands; we were copying the entire, long
      string for each command, resulting in O(N^2) behavior for N commands.
      (This is the cause of bug #4079.)  A second problem with it is that
      PortalDefineQuery really can't risk error, because if it elog's before
      having set up the Portal, we will leak the plancache refcount that the
      caller is trying to hand off to the portal.  So go back to the design in
      which the caller is responsible for making sure everything is copied into
      the portal if necessary.
      ab2071b5
  8. 01 4月, 2008 2 次提交
    • T
      Fix an oversight I made in a cleanup patch over a year ago: · e3a47483
      Tom Lane 提交于
      eval_const_expressions needs to be passed the PlannerInfo ("root") structure,
      because in some cases we want it to substitute values for Param nodes.
      (So "constant" is not so constant as all that ...)  This mistake partially
      disabled optimization of unnamed extended-Query statements in 8.3: in
      particular the LIKE-to-indexscan optimization would never be applied if the
      LIKE pattern was passed as a parameter, and constraint exclusion depending
      on a parameter value didn't work either.
      e3a47483
    • T
      Apply my original fix for Taiki Yamaguchi's bug report about DISTINCT MAX(). · f82277c8
      Tom Lane 提交于
      Add some regression tests for plausible failures in this area.
      f82277c8
  9. 31 3月, 2008 1 次提交
    • T
      Fix a number of places that were making file-type tests infelicitously. · 793c5835
      Tom Lane 提交于
      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.)
      793c5835
  10. 29 3月, 2008 1 次提交
  11. 28 3月, 2008 1 次提交
    • T
      When we have successfully optimized a MIN or MAX aggregate into an indexscan, · 707867e9
      Tom Lane 提交于
      the query result must be exactly one row (since we don't do this when there's
      any GROUP BY).  Therefore any ORDER BY or DISTINCT attached to the query is
      useless and can be dropped.  Aside from saving useless cycles, this protects
      us against problems with matching the hacked-up tlist entries to sort clauses,
      as seen in a bug report from Taiki Yamaguchi.  We might need to work harder
      if we ever try to optimize grouped queries with this approach, but this
      solution will do for now.
      707867e9
  12. 26 3月, 2008 2 次提交
  13. 25 3月, 2008 3 次提交
  14. 22 3月, 2008 1 次提交
  15. 21 3月, 2008 2 次提交
  16. 20 3月, 2008 1 次提交
    • H
      Add the missing cyrillic "Yo" characters ('e' and 'E' with two dots) to the · 59c4fc5a
      Heikki Linnakangas 提交于
      ISO_8859-5 <-> MULE_INTERNAL conversion tables.
      
      This was discovered when trying to convert a string containing those characters
      from ISO_8859-5 to Windows-1251, because we use MULE_INTERNAL/KOI8R as an
      intermediate encoding between those two.
      
      While the missing "Yo" was just an omission in the conversion tables, there are
      a few other characters like the "Numero" sign ("No" as a single character) that
      exists in all the other cyrillic encodings (win1251, ISO_8859-5 and cp866), but
      not in KOI8R. Added comments about that.
      
      Patch by Sergey Burladyan. Back-patch to 7.4.
      59c4fc5a
  17. 19 3月, 2008 3 次提交
  18. 15 3月, 2008 3 次提交
  19. 14 3月, 2008 7 次提交
  20. 13 3月, 2008 2 次提交
    • T
      Fix pg_plan_queries() to restore the previous setting of ActiveSnapshot · 1dd56fda
      Tom Lane 提交于
      (probably NULL) before exiting.  Up to now it's just left the variable as it
      set it, which means that after we're done processing the current client
      message, ActiveSnapshot is probably pointing at garbage (because this function
      is typically run in MessageContext which will get reset).  There doesn't seem
      to have been any code path in which that mattered before 8.3, but now the
      plancache module might try to use the stale value if the next client message
      is a Bind for a prepared statement that is in need of replanning.  Per report
      from Alex Hunsaker.
      1dd56fda
    • T
      Fix LISTEN/NOTIFY race condition reported by Laurent Birtz, by postponing · d2ab94da
      Tom Lane 提交于
      pg_listener modifications commanded by LISTEN and UNLISTEN until the end
      of the current transaction.  This allows us to hold the ExclusiveLock on
      pg_listener until after commit, with no greater risk of deadlock than there
      was before.  Aside from fixing the race condition, this gets rid of a
      truly ugly kludge that was there before, namely having to ignore
      HeapTupleBeingUpdated failures during NOTIFY.  There is a small potential
      incompatibility, which is that if a transaction issues LISTEN or UNLISTEN
      and then looks into pg_listener before committing, it won't see any resulting
      row insertion or deletion, where before it would have.  It seems unlikely
      that anyone would be depending on that, though.
      
      This patch also disallows LISTEN and UNLISTEN inside a prepared transaction.
      That case had some pretty undesirable properties already, such as possibly
      allowing pg_listener entries to be made for PIDs no longer present, so
      disallowing it seems like a better idea than trying to maintain the behavior.
      d2ab94da
  21. 12 3月, 2008 1 次提交
    • B
      Add to documentation: · 32aaf480
      Bruce Momjian 提交于
      +         Setting <varname>statement_timeout</> in
      +         <filename>postgresql.conf</> is not recommended because it
      +         affects all sessions.
      
      Backpatch to 8.3.X.
      32aaf480
  22. 11 3月, 2008 1 次提交