Skip to content
Snippets Groups Projects
  1. Jun 21, 2017
    • Tom Lane's avatar
      Phase 3 of pgindent updates. · 382ceffd
      Tom Lane authored
      Don't move parenthesized lines to the left, even if that means they
      flow past the right margin.
      
      By default, BSD indent lines up statement continuation lines that are
      within parentheses so that they start just to the right of the preceding
      left parenthesis.  However, traditionally, if that resulted in the
      continuation line extending to the right of the desired right margin,
      then indent would push it left just far enough to not overrun the margin,
      if it could do so without making the continuation line start to the left of
      the current statement indent.  That makes for a weird mix of indentations
      unless one has been completely rigid about never violating the 80-column
      limit.
      
      This behavior has been pretty universally panned by Postgres developers.
      Hence, disable it with indent's new -lpl switch, so that parenthesized
      lines are always lined up with the preceding left paren.
      
      This patch is much less interesting than the first round of indent
      changes, but also bulkier, so I thought it best to separate the effects.
      
      Discussion: https://postgr.es/m/E1dAmxK-0006EE-1r@gemulon.postgresql.org
      Discussion: https://postgr.es/m/30527.1495162840@sss.pgh.pa.us
      382ceffd
  2. Mar 13, 2017
    • Noah Misch's avatar
      Use wrappers of PG_DETOAST_DATUM_PACKED() more. · 3a0d4731
      Noah Misch authored
      This makes almost all core code follow the policy introduced in the
      previous commit.  Specific decisions:
      
      - Text search support functions with char* and length arguments, such as
        prsstart and lexize, may receive unaligned strings.  I doubt
        maintainers of non-core text search code will notice.
      
      - Use plain VARDATA() on values detoasted or synthesized earlier in the
        same function.  Use VARDATA_ANY() on varlenas sourced outside the
        function, even if they happen to always have four-byte headers.  As an
        exception, retain the universal practice of using VARDATA() on return
        values of SendFunctionCall().
      
      - Retain PG_GETARG_BYTEA_P() in pageinspect.  (Page images are too large
        for a one-byte header, so this misses no optimization.)  Sites that do
        not call get_page_from_raw() typically need the four-byte alignment.
      
      - For now, do not change btree_gist.  Its use of four-byte headers in
        memory is partly entangled with storage of 4-byte headers inside
        GBT_VARKEY, on disk.
      
      - For now, do not change gtrgm_consistent() or gtrgm_distance().  They
        incorporate the varlena header into a cache, and there are multiple
        credible implementation strategies to consider.
      3a0d4731
  3. Jan 21, 2017
  4. Jan 03, 2017
  5. Jun 14, 2016
  6. Mar 16, 2016
  7. Jan 02, 2016
  8. Sep 04, 2015
  9. Jan 06, 2015
  10. Aug 25, 2014
  11. Jul 14, 2014
  12. Jul 01, 2014
    • Tom Lane's avatar
      Fix inadequately-sized output buffer in contrib/unaccent. · 5a421a47
      Tom Lane authored
      The output buffer size in unaccent_lexize() was calculated as input string
      length times pg_database_encoding_max_length(), which effectively assumes
      that replacement strings aren't more than one character.  While that was
      all that we previously documented it to support, the code actually has
      always allowed replacement strings of arbitrary length; so if you tried
      to make use of longer strings, you were at risk of buffer overrun.  To fix,
      use an expansible StringInfo buffer instead of trying to determine the
      maximum space needed a-priori.
      
      This would be a security issue if unaccent rules files could be installed
      by unprivileged users; but fortunately they can't, so in the back branches
      the problem can be labeled as improper configuration by a superuser.
      Nonetheless, a memory stomp isn't a nice way of reacting to improper
      configuration, so let's back-patch the fix.
      5a421a47
    • Tom Lane's avatar
      Issue a WARNING about invalid rule file format in contrib/unaccent. · 03a25cec
      Tom Lane authored
      We were already issuing a WARNING, albeit only elog not ereport, for
      duplicate source strings; so warning rather than just being stoically
      silent seems like the best thing to do here.  Arguably both of these
      complaints should be upgraded to ERRORs, but that might be more
      behavioral change than people want.
      
      Note: the faulty line is already printed via an errcontext hook,
      so there's no need for more information than these messages provide.
      03a25cec
    • Tom Lane's avatar
      Allow multi-character source strings in contrib/unaccent. · 1b248873
      Tom Lane authored
      This could be useful in languages where diacritic signs are represented as
      separate characters; more generally it supports using unaccent dictionaries
      for substring substitutions beyond narrowly conceived "diacritic removal".
      In any case, since the rule-file parser doesn't complain about
      multi-character source strings, it behooves us to do something unsurprising
      with them.
      1b248873
    • Tom Lane's avatar
      Allow empty replacement strings in contrib/unaccent. · 97c40ce6
      Tom Lane authored
      This is useful in languages where diacritic signs are represented as
      separate characters; it's also one step towards letting unaccent be used
      for arbitrary substring substitutions.
      
      In passing, improve the user documentation for unaccent, which was sadly
      vague about some important details.
      
      Mohammad Alhashash, reviewed by Abhijit Menon-Sen
      97c40ce6
  13. 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
  14. Jan 07, 2014
  15. Nov 18, 2013
  16. Oct 08, 2013
  17. May 29, 2013
  18. May 08, 2013
  19. Jan 01, 2013
  20. Apr 22, 2012
  21. Jan 02, 2012
  22. Nov 07, 2011
    • Tom Lane's avatar
      Fix assorted bugs in contrib/unaccent's configuration file parsing. · ced3a93c
      Tom Lane authored
      Make it use t_isspace() to identify whitespace, rather than relying on
      sscanf which is known to get it wrong on some platform/locale combinations.
      Get rid of fixed-size buffers.  Make it actually continue to parse the file
      after ignoring a line with untranslatable characters, as was obviously
      intended.
      
      The first of these issues is per gripe from J Smith, though not exactly
      either of his proposed patches.
      ced3a93c
  23. 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
  24. Sep 01, 2011
  25. Apr 25, 2011
    • Peter Eisentraut's avatar
      Support "make check" in contrib · f8ebe3bc
      Peter Eisentraut authored
      Added a new option --extra-install to pg_regress to arrange installing
      the respective contrib directory into the temporary installation.
      This is currently not yet supported for Windows MSVC builds.
      
      Updated the .gitignore files for contrib modules to ignore the
      leftovers of a temp-install check run.
      
      Changed the exit status of "make check" in a pgxs build (which still
      does nothing) to 0 from 1.
      
      Added "make check" in contrib to top-level "make check-world".
      f8ebe3bc
  26. Apr 19, 2011
  27. Apr 18, 2011
  28. Apr 15, 2011
  29. Feb 17, 2011
  30. Feb 14, 2011
    • 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
  31. Jan 01, 2011
  32. Dec 27, 2010
  33. Nov 23, 2010
  34. Sep 22, 2010
Loading