Skip to content
Snippets Groups Projects
  1. Sep 08, 2015
    • Alvaro Herrera's avatar
    • Alvaro Herrera's avatar
      contrib/sslinfo: add ssl_extension_info SRF · 49124613
      Alvaro Herrera authored
      This new function provides information about SSL extensions present in
      the X509 certificate used for the current connection.
      
      Extension version updated to version 1.1.
      
      Author: Дмитрий Воронин (Dmitry Voronin)
      Reviewed by: Michael Paquier, Heikki Linnakangas, Álvaro Herrera
      49124613
    • Alvaro Herrera's avatar
      Add more sanity checks in contrib/sslinfo · d94c36a4
      Alvaro Herrera authored
      We were missing a few return checks on OpenSSL calls.  Should be pretty
      harmless, since we haven't seen any user reports about problems, and
      this is not a high-traffic module anyway; still, a bug is a bug, so
      backpatch this all the way back to 9.0.
      
      Author: Michael Paquier, while reviewing another sslinfo patch
      d94c36a4
  2. Sep 06, 2015
  3. Sep 05, 2015
    • Tom Lane's avatar
      Rearrange the handling of error context reports. · 0426f349
      Tom Lane authored
      Remove the code in plpgsql that suppressed the innermost line of CONTEXT
      for messages emitted by RAISE commands.  That was never more than a quick
      backwards-compatibility hack, and it's pretty silly in cases where the
      RAISE is nested in several levels of function.  What's more, it violated
      our design theory that verbosity of error reports should be controlled
      on the client side not the server side.
      
      To alleviate the resulting noise increase, introduce a feature in libpq
      and psql whereby the CONTEXT field of messages can be suppressed, either
      always or only for non-error messages.  Printing CONTEXT for errors only
      is now their default behavior.
      
      The actual code changes here are pretty small, but the effects on the
      regression test outputs are widespread.  I had to edit some of the
      alternative expected outputs by hand; hopefully the buildfarm will soon
      find anything I fat-fingered.
      
      In passing, fix up (again) the output line counts in psql's various
      help displays.  Add some commentary about how to verify them.
      
      Pavel Stehule, reviewed by Petr Jelínek, Jeevan Chalke, and others
      0426f349
    • Heikki Linnakangas's avatar
      Fix misc typos. · c80b5f66
      Heikki Linnakangas authored
      Oskari Saarenmaa. Backpatch to stable branches where applicable.
      c80b5f66
  4. Sep 04, 2015
  5. Aug 30, 2015
    • Joe Conway's avatar
      Fix sepgsql regression tests. · 794e2558
      Joe Conway authored
      The regression tests for sepgsql were broken by changes in the
      base distro as-shipped policies. Specifically, definition of
      unconfined_t in the system default policy was changed to bypass
      multi-category rules, which the regression test depended on.
      Fix that by defining a custom privileged domain
      (sepgsql_regtest_superuser_t) and using it instead of system's
      unconfined_t domain. The new sepgsql_regtest_superuser_t domain
      performs almost like the current unconfined_t, but restricted by
      multi-category policy as the traditional unconfined_t was.
      
      The custom policy module is a self defined domain, and so should not
      be affected by related future system policy changes. However, it still
      uses the unconfined_u:unconfined_r pair for selinux-user and role.
      Those definitions have not been changed for several years and seem
      less risky to rely on than the unconfined_t domain. Additionally, if
      we define custom user/role, they would need to be manually defined
      at the operating system level, adding more complexity to an already
      non-standard and complex regression test.
      
      Back-patch to 9.3. The regression tests will need more work before
      working correctly on 9.2. Starting with 9.2, sepgsql has had dependencies
      on libselinux versions that are only available on newer distros with
      the changed set of policies (e.g. RHEL 7.x). On 9.1 sepgsql works
      fine with the older distros with original policy set (e.g. RHEL 6.x),
      and on which the existing regression tests work fine. We might want
      eventually change 9.1 sepgsql regression tests to be more independent
      from the underlying OS policies, however more work will be needed to
      make that happen and it is not clear that it is worth the effort.
      
      Kohei KaiGai with review by Adam Brightwell and me, commentary by
      Stephen, Alvaro, Tom, Robert, and others.
      794e2558
  6. Aug 23, 2015
  7. Aug 15, 2015
  8. Aug 13, 2015
    • Alvaro Herrera's avatar
      Use materialize SRF mode in brin_page_items · 94d626ff
      Alvaro Herrera authored
      This function was using the single-value-per-call mechanism, but the
      code relied on a relcache entry that wasn't kept open across calls.
      This manifested as weird errors in buildfarm during the short time that
      the "brin-1" isolation test lived.
      
      Backpatch to 9.5, where it was introduced.
      94d626ff
  9. Aug 10, 2015
    • Andres Freund's avatar
      Add confirmed_flush column to pg_replication_slots. · 3f811c2d
      Andres Freund authored
      There's no reason not to expose both restart_lsn and confirmed_flush
      since they have rather distinct meanings. The former is the oldest WAL
      still required and valid for both physical and logical slots, whereas
      the latter is the location up to which a logical slot's consumer has
      confirmed receiving data. Most of the time a slot will require older
      WAL (i.e. restart_lsn) than the confirmed
      position (i.e. confirmed_flush_lsn).
      
      Author: Marko Tiikkaja, editorialized by me
      Discussion: 559D110B.1020109@joh.to
      3f811c2d
  10. Aug 03, 2015
    • Tom Lane's avatar
      contrib/isn now needs a .gitignore file. · fd7ed26c
      Tom Lane authored
      Oversight in commit cb3384a0.
      Back-patch to 9.1, like that commit.
      fd7ed26c
    • Tom Lane's avatar
      Fix a number of places that produced XX000 errors in the regression tests. · 09cecdf2
      Tom Lane authored
      It's against project policy to use elog() for user-facing errors, or to
      omit an errcode() selection for errors that aren't supposed to be "can't
      happen" cases.  Fix all the violations of this policy that result in
      ERRCODE_INTERNAL_ERROR log entries during the standard regression tests,
      as errors that can reliably be triggered from SQL surely should be
      considered user-facing.
      
      I also looked through all the files touched by this commit and fixed
      other nearby problems of the same ilk.  I do not claim to have fixed
      all violations of the policy, just the ones in these files.
      
      In a few places I also changed existing ERRCODE choices that didn't
      seem particularly appropriate; mainly replacing ERRCODE_SYNTAX_ERROR
      by something more specific.
      
      Back-patch to 9.5, but no further; changing ERRCODE assignments in
      stable branches doesn't seem like a good idea.
      09cecdf2
  11. Aug 02, 2015
    • Heikki Linnakangas's avatar
      Fix output of ISBN-13 numbers beginning with 979. · cb3384a0
      Heikki Linnakangas authored
      An EAN beginning with 979 (but not 9790 - those are ISMN's) are accepted
      as ISBN numbers, but they cannot be represented in the old, 10-digit ISBN
      format. They must be output in the new 13-digit ISBN-13 format. We printed
      out an incorrect value for those.
      
      Also add a regression test, to test this and some other basic functionality
      of the module.
      
      Patch by Fabien Coelho. This fixes bug #13442, reported by B.Z. Backpatch
      to 9.1, where we started to recognize ISBN-13 numbers.
      cb3384a0
  12. Jul 25, 2015
    • Tom Lane's avatar
      Some platforms now need contrib/tsm_system_time to be linked with libm. · c879d51c
      Tom Lane authored
      Buildfarm member hornet, at least, seems to want -lm in the link command.
      Probably this is due to the just-added use of isnan().
      c879d51c
    • Tom Lane's avatar
      Redesign tablesample method API, and do extensive code review. · dd7a8f66
      Tom Lane authored
      The original implementation of TABLESAMPLE modeled the tablesample method
      API on index access methods, which wasn't a good choice because, without
      specialized DDL commands, there's no way to build an extension that can
      implement a TSM.  (Raw inserts into system catalogs are not an acceptable
      thing to do, because we can't undo them during DROP EXTENSION, nor will
      pg_upgrade behave sanely.)  Instead adopt an API more like procedural
      language handlers or foreign data wrappers, wherein the only SQL-level
      support object needed is a single handler function identified by having
      a special return type.  This lets us get rid of the supporting catalog
      altogether, so that no custom DDL support is needed for the feature.
      
      Adjust the API so that it can support non-constant tablesample arguments
      (the original coding assumed we could evaluate the argument expressions at
      ExecInitSampleScan time, which is undesirable even if it weren't outright
      unsafe), and discourage sampling methods from looking at invisible tuples.
      Make sure that the BERNOULLI and SYSTEM methods are genuinely repeatable
      within and across queries, as required by the SQL standard, and deal more
      honestly with methods that can't support that requirement.
      
      Make a full code-review pass over the tablesample additions, and fix
      assorted bugs, omissions, infelicities, and cosmetic issues (such as
      failure to put the added code stanzas in a consistent ordering).
      Improve EXPLAIN's output of tablesample plans, too.
      
      Back-patch to 9.5 so that we don't have to support the original API
      in production.
      dd7a8f66
  13. Jul 21, 2015
  14. Jul 20, 2015
  15. Jul 18, 2015
  16. Jul 16, 2015
    • Noah Misch's avatar
      AIX: Link TRANSFORM modules with their dependencies. · 71934367
      Noah Misch authored
      The result closely resembles linking of these modules for the "win32"
      port.  Augment the $(exports_file) header so the file is also usable as
      an import file.  Unfortunately, relocating an AIX installation will now
      require adding $(pkglibdir) to LD_LIBRARY_PATH.  Back-patch to 9.5,
      where the modules were introduced.
      71934367
    • Noah Misch's avatar
      MinGW: Link ltree_plpython with plpython. · 736c1f23
      Noah Misch authored
      The MSVC build system already did this, and building against Python 3
      requires it.  Back-patch to 9.5, where the module was introduced.
      736c1f23
  17. Jul 14, 2015
  18. Jul 09, 2015
  19. Jul 02, 2015
  20. Jun 27, 2015
    • Andres Freund's avatar
      Fix test_decoding's handling of nonexistant columns in old tuple versions. · d47a1136
      Andres Freund authored
      test_decoding used fastgetattr() to extract column values. That's wrong
      when decoding updates and deletes if a table's replica identity is set
      to FULL and new columns have been added since the old version of the
      tuple was created. Due to the lack of a crosscheck with the datum's
      natts values an invalid value will be output, leading to errors or
      worse.
      
      Bug: #13470
      Reported-By: Krzysztof Kotlarski
      Discussion: 20150626100333.3874.90852@wrigleys.postgresql.org
      
      Backpatch to 9.4, where the feature, including the bug, was added.
      d47a1136
  21. May 31, 2015
    • Peter Eisentraut's avatar
      Make Python tests more portable · 75f9d176
      Peter Eisentraut authored
      Newer Python versions randomize the hash seed for dictionaries,
      resulting in a random output order, which messes up the regression test
      diffs.
      
      Instead, use Python assert to compare the dictionaries with their
      expected value.
      75f9d176
  22. May 28, 2015
  23. May 24, 2015
    • Tom Lane's avatar
      Manual cleanup of pgindent results. · 2aa0476d
      Tom Lane authored
      Fix some places where pgindent did silly stuff, often because project
      style wasn't followed to begin with.  (I've not touched the atomics
      headers, though.)
      2aa0476d
    • Tom Lane's avatar
      Remove no-longer-required function declarations. · 91e79260
      Tom Lane authored
      Remove a bunch of "extern Datum foo(PG_FUNCTION_ARGS);" declarations that
      are no longer needed now that PG_FUNCTION_INFO_V1(foo) provides that.
      
      Some of these were evidently missed in commit e7128e8d, but others
      were cargo-culted in in code added since then.  Possibly that can be blamed
      in part on the fact that we'd not fixed relevant documentation examples,
      which I've now done.
      91e79260
    • Bruce Momjian's avatar
      pgindent run for 9.5 · 807b9e0d
      Bruce Momjian authored
      807b9e0d
  24. May 20, 2015
    • Heikki Linnakangas's avatar
      Collection of typo fixes. · 4fc72cc7
      Heikki Linnakangas authored
      Use "a" and "an" correctly, mostly in comments. Two error messages were
      also fixed (they were just elogs, so no translation work required). Two
      function comments in pg_proc.h were also fixed. Etsuro Fujita reported one
      of these, but I found a lot more with grep.
      
      Also fix a few other typos spotted while grepping for the a/an typos.
      For example, "consists out of ..." -> "consists of ...". Plus a "though"/
      "through" mixup reported by Euler Taveira.
      
      Many of these typos were in old code, which would be nice to backpatch to
      make future backpatching easier. But much of the code was new, and I didn't
      feel like crafting separate patches for each branch. So no backpatching.
      4fc72cc7
  25. May 19, 2015
    • Andres Freund's avatar
      Refactor ON CONFLICT index inference parse tree representation. · 0740cbd7
      Andres Freund authored
      Defer lookup of opfamily and input type of a of a user specified opclass
      until the optimizer selects among available unique indexes; and store
      the opclass in the parse analyzed tree instead.  The primary reason for
      doing this is that for rule deparsing it's easier to use the opclass
      than the previous representation.
      
      While at it also rename a variable in the inference code to better fit
      it's purpose.
      
      This is separate from the actual fixes for deparsing to make review
      easier.
      0740cbd7
    • Peter Eisentraut's avatar
      Fix parse tree of DROP TRANSFORM and COMMENT ON TRANSFORM · 0779f2ba
      Peter Eisentraut authored
      The plain C string language name needs to be wrapped in makeString() so
      that the parse tree is copyable.  This is detectable by
      -DCOPY_PARSE_PLAN_TREES.  Add a test case for the COMMENT case.
      
      Also make the quoting in the error messages more consistent.
      
      discovered by Tom Lane
      0779f2ba
  26. May 18, 2015
    • Noah Misch's avatar
      pgcrypto: Report errant decryption as "Wrong key or corrupt data". · 85270ac7
      Noah Misch authored
      This has been the predominant outcome.  When the output of decrypting
      with a wrong key coincidentally resembled an OpenPGP packet header,
      pgcrypto could instead report "Corrupt data", "Not text data" or
      "Unsupported compression algorithm".  The distinct "Corrupt data"
      message added no value.  The latter two error messages misled when the
      decrypted payload also exhibited fundamental integrity problems.  Worse,
      error message variance in other systems has enabled cryptologic attacks;
      see RFC 4880 section "14. Security Considerations".  Whether these
      pgcrypto behaviors are likewise exploitable is unknown.
      
      In passing, document that pgcrypto does not resist side-channel attacks.
      Back-patch to 9.0 (all supported versions).
      
      Security: CVE-2015-3167
      85270ac7
    • Tom Lane's avatar
      Use += not = to set makefile variables after including base makefiles. · b14cf229
      Tom Lane authored
      The previous coding in hstore_plpython and ltree_plpython wiped out any
      values set by the base makefiles.  This at least had the effect of running
      the tests in "regression" not "contrib_regression" as expected.  These
      being pretty new modules, there might be other bad effects we'd not
      noticed yet.
      b14cf229
Loading