Skip to content
Snippets Groups Projects
  1. Jan 21, 2017
  2. Jan 03, 2017
  3. Jun 07, 2016
  4. Jan 22, 2016
    • Tom Lane's avatar
      Remove new coupling between NAMEDATALEN and MAX_LEVENSHTEIN_STRLEN. · a396144a
      Tom Lane authored
      Commit e529cd4f introduced an Assert requiring NAMEDATALEN to be
      less than MAX_LEVENSHTEIN_STRLEN, which has been 255 for a long time.
      Since up to that instant we had always allowed NAMEDATALEN to be
      substantially more than that, this was ill-advised.
      
      It's debatable whether we need MAX_LEVENSHTEIN_STRLEN at all (versus
      putting a CHECK_FOR_INTERRUPTS into the loop), or whether it has to be
      so tight; but this patch takes the narrower approach of just not applying
      the MAX_LEVENSHTEIN_STRLEN limit to calls from the parser.
      
      Trusting the parser for this seems reasonable, first because the strings
      are limited to NAMEDATALEN which is unlikely to be hugely more than 256,
      and second because the maximum distance is tightly constrained by
      MAX_FUZZY_DISTANCE (though we'd forgotten to make use of that limit in one
      place).  That means the cost is not really O(mn) but more like O(max(m,n)).
      
      Relaxing the limit for user-supplied calls is left for future research;
      given the lack of complaints to date, it doesn't seem very high priority.
      
      In passing, fix confusion between lengths-in-bytes and lengths-in-chars
      in comments and error messages.
      
      Per gripe from Kevin Day; solution suggested by Robert Haas.  Back-patch
      to 9.5 where the unwanted restriction was introduced.
      a396144a
  5. Jan 02, 2016
  6. May 24, 2015
  7. Feb 03, 2015
    • Heikki Linnakangas's avatar
      Remove dead code. · 4eaafa04
      Heikki Linnakangas authored
      Commit 13629df5 changed metaphone() function to return an empty string on
      empty input, but it left the old error message in place. It's now dead code.
      
      Michael Paquier, per Coverity warning.
      4eaafa04
  8. Jan 24, 2015
    • Tom Lane's avatar
      Replace a bunch more uses of strncpy() with safer coding. · 586dd5d6
      Tom Lane authored
      strncpy() has a well-deserved reputation for being unsafe, so make an
      effort to get rid of nearly all occurrences in HEAD.
      
      A large fraction of the remaining uses were passing length less than or
      equal to the known strlen() of the source, in which case no null-padding
      can occur and the behavior is equivalent to memcpy(), though doubtless
      slower and certainly harder to reason about.  So just use memcpy() in
      these cases.
      
      In other cases, use either StrNCpy() or strlcpy() as appropriate (depending
      on whether padding to the full length of the destination buffer seems
      useful).
      
      I left a few strncpy() calls alone in the src/timezone/ code, to keep it
      in sync with upstream (the IANA tzcode distribution).  There are also a
      few such calls in ecpg that could possibly do with more analysis.
      
      AFAICT, none of these changes are more than cosmetic, except for the four
      occurrences in fe-secure-openssl.c, which are in fact buggy: an overlength
      source leads to a non-null-terminated destination buffer and ensuing
      misbehavior.  These don't seem like security issues, first because no stack
      clobber is possible and second because if your values of sslcert etc are
      coming from untrusted sources then you've got problems way worse than this.
      Still, it's undesirable to have unpredictable behavior for overlength
      inputs, so back-patch those four changes to all active branches.
      586dd5d6
  9. Jan 06, 2015
  10. Jan 04, 2015
  11. Nov 13, 2014
  12. Sep 26, 2014
  13. Aug 25, 2014
  14. Jul 14, 2014
  15. May 06, 2014
    • Bruce Momjian's avatar
      pgindent run for 9.4 · 0a783200
      Bruce Momjian authored
      This includes removing tabs after periods in C comments, which was
      applied to back branches, so this change should not effect backpatching.
      0a783200
  16. Apr 18, 2014
    • Peter Eisentraut's avatar
      Create function prototype as part of PG_FUNCTION_INFO_V1 macro · e7128e8d
      Peter Eisentraut authored
      Because of gcc -Wmissing-prototypes, all functions in dynamically
      loadable modules must have a separate prototype declaration.  This is
      meant to detect global functions that are not declared in header files,
      but in cases where the function is called via dfmgr, this is redundant.
      Besides filling up space with boilerplate, this is a frequent source of
      compiler warnings in extension modules.
      
      We can fix that by creating the function prototype as part of the
      PG_FUNCTION_INFO_V1 macro, which such modules have to use anyway.  That
      makes the code of modules cleaner, because there is one less place where
      the entry points have to be listed, and creates an additional check that
      functions have the right prototype.
      
      Remove now redundant prototypes from contrib and other modules.
      e7128e8d
  17. Jan 07, 2014
  18. Sep 11, 2013
  19. Jan 01, 2013
  20. May 02, 2012
  21. Apr 24, 2012
  22. Jan 02, 2012
  23. Dec 27, 2011
  24. Oct 12, 2011
    • Tom Lane's avatar
      Throw a useful error message if an extension script file is fed to psql. · 458857cc
      Tom Lane authored
      We have seen one too many reports of people trying to use 9.1 extension
      files in the old-fashioned way of sourcing them in psql.  Not only does
      that usually not work (due to failure to substitute for MODULE_PATHNAME
      and/or @extschema@), but if it did work they'd get a collection of loose
      objects not an extension.  To prevent this, insert an \echo ... \quit
      line that prints a suitable error message into each extension script file,
      and teach commands/extension.c to ignore lines starting with \echo.
      That should not only prevent any adverse consequences of loading a script
      file the wrong way, but make it crystal clear to users that they need to
      do it differently now.
      
      Tom Lane, following an idea of Andrew Dunstan's.  Back-patch into 9.1
      ... there is not going to be much value in this if we wait till 9.2.
      458857cc
  25. Sep 01, 2011
  26. Jul 19, 2011
  27. Apr 10, 2011
  28. Feb 20, 2011
  29. Feb 14, 2011
    • Tom Lane's avatar
      Assorted fixups for "unpackaged" conversion scripts. · 3b61e57f
      Tom Lane authored
      From first pass of testing.  Notably, there seems to be no need for
      adminpack--unpackaged--1.0.sql because none of the objects that the
      old module creates would ever be dumped by pg_dump anyway (they are
      all in pg_catalog).
      3b61e57f
    • Tom Lane's avatar
      Avoid use of CREATE OR REPLACE FUNCTION in extension installation files. · 029fac22
      Tom Lane authored
      It was never terribly consistent to use OR REPLACE (because of the lack of
      comparable functionality for data types, operators, etc), and
      experimentation shows that it's now positively pernicious in the extension
      world.  We really want a failure to occur if there are any conflicts, else
      it's unclear what the extension-ownership state of the conflicted object
      ought to be.  Most of the time, CREATE EXTENSION will fail anyway because
      of conflicts on other object types, but an extension defining only
      functions can succeed, with bad results.
      029fac22
    • Tom Lane's avatar
      Convert contrib modules to use the extension facility. · 629b3af2
      Tom Lane authored
      This isn't fully tested as yet, in particular I'm not sure that the
      "foo--unpackaged--1.0.sql" scripts are OK.  But it's time to get some
      buildfarm cycles on it.
      
      sepgsql is not converted to an extension, mainly because it seems to
      require a very nonstandard installation process.
      
      Dimitri Fontaine and Tom Lane
      629b3af2
  30. Jan 01, 2011
  31. Nov 23, 2010
  32. Oct 22, 2010
  33. Oct 19, 2010
  34. Sep 24, 2010
  35. Sep 22, 2010
  36. Sep 20, 2010
  37. Aug 03, 2010
  38. Jul 29, 2010
Loading