1. 05 Dec, 2014 7 commits
  2. 04 Dec, 2014 6 commits
    • Andres Freund's avatar
      Document that pg_stat_*_tables.n_tup_upd includes n_tup_hot_upd. · 5ede3a31
      Andres Freund authored
      Author: Peter Geoghegan
      5ede3a31
    • Peter Eisentraut's avatar
      Fix PGXS vpath build when PostgreSQL is built with vpath · b58233c7
      Peter Eisentraut authored
      PGXS computes srcdir from VPATH, PostgreSQL proper computes VPATH from
      srcdir, and doing both results in an error from make.  Conditionalize so
      only one of these takes effect.
      b58233c7
    • Peter Eisentraut's avatar
      Revert haphazard pgxs makefile changes · e4b5a070
      Peter Eisentraut authored
      These changes were originally submitted as "adds support for VPATH with
      USE_PGXS", but they are not necessary for VPATH support, so they just
      add more lines of code for no reason.
      e4b5a070
    • Peter Eisentraut's avatar
      Remove USE_VPATH make variable from PGXS · eb1c3f47
      Peter Eisentraut authored
      The user can just set VPATH directly.  There is no need to invent
      another variable.
      eb1c3f47
    • Peter Eisentraut's avatar
      Fix SHLIB_PREREQS use in contrib, allowing PGXS builds · 1e95bbc8
      Peter Eisentraut authored
      dblink and postgres_fdw use SHLIB_PREREQS = submake-libpq to build libpq
      first.  This doesn't work in a PGXS build, because there is no libpq to
      build.  So just omit setting SHLIB_PREREQS in this case.
      
      Note that PGXS users can still use SHLIB_PREREQS (although it is not
      documented).  The problem here is only that contrib modules can be built
      in-tree or using PGXS, and the prerequisite is only applicable in the
      former case.
      
      Commit 6697aa2b previously attempted to
      address this by creating a somewhat fake submake-libpq target in
      Makefile.global.  That was not the right fix, and it was also done in a
      nonportable way, so revert that.
      1e95bbc8
    • Peter Eisentraut's avatar
      Move PG_AUTOCONF_FILENAME definition · e86507d7
      Peter Eisentraut authored
      Since this is not something that a user should change,
      pg_config_manual.h was an inappropriate place for it.
      
      In initdb.c, remove the use of the macro, because utils/guc.h can't be
      included by non-backend code.  But we hardcode all the other
      configuration file names there, so this isn't a disaster.
      e86507d7
  3. 03 Dec, 2014 5 commits
    • Alvaro Herrera's avatar
      doc: Fix markup · 182362b6
      Alvaro Herrera authored
      In the spirit of d34b48a0
      
      Per buildfarm member guaibasaurus, via Stefan Kaltenbrunner.
      182362b6
    • Alvaro Herrera's avatar
      Keep track of transaction commit timestamps · 73c986ad
      Alvaro Herrera authored
      Transactions can now set their commit timestamp directly as they commit,
      or an external transaction commit timestamp can be fed from an outside
      system using the new function TransactionTreeSetCommitTsData().  This
      data is crash-safe, and truncated at Xid freeze point, same as pg_clog.
      
      This module is disabled by default because it causes a performance hit,
      but can be enabled in postgresql.conf requiring only a server restart.
      
      A new test in src/test/modules is included.
      
      Catalog version bumped due to the new subdirectory within PGDATA and a
      couple of new SQL functions.
      
      Authors: Álvaro Herrera and Petr Jelínek
      
      Reviewed to varying degrees by Michael Paquier, Andres Freund, Robert
      Haas, Amit Kapila, Fujii Masao, Jaime Casanova, Simon Riggs, Steven
      Singer, Peter Eisentraut
      73c986ad
    • Alvaro Herrera's avatar
      Fix typos · 6597ec9b
      Alvaro Herrera authored
      6597ec9b
    • Peter Eisentraut's avatar
      Fix whitespace · bc2f43ea
      Peter Eisentraut authored
      bc2f43ea
    • Alvaro Herrera's avatar
      Install kludges to fix check-world for src/test/modules · da34731b
      Alvaro Herrera authored
      check-world failed in a completely clean tree, because src/test/modules
      fail to build unless errcodes.h is generated first.  To fix this,
      install a dependency in src/test/modules' Makefile so that the necessary
      file is generated.  Even with this, running "make check" within
      individual module subdirs will still fail because the dependency is not
      considered there, but this case is less interesting and would be messier
      to fix.
      
      check-world still failed with the above fix in place, this time because
      dummy_seclabel used LOAD to load the dynamic library, which doesn't work
      because the @libdir@ (expanded by the makefile) is expanded to the final
      install path, not the temporary installation directory used by make
      check.  To fix, tweak things so that CREATE EXTENSION can be used
      instead, which solves the problem because the library path is expanded
      by the backend, which is aware of the true libdir.
      da34731b
  4. 02 Dec, 2014 6 commits
    • Tom Lane's avatar
      Improve error messages for malformed array input strings. · 475aedd1
      Tom Lane authored
      Make the error messages issued by array_in() uniformly follow the style
      	ERROR: malformed array literal: "actual input string"
      	DETAIL: specific complaint here
      and rewrite many of the specific complaints to be clearer.
      
      The immediate motivation for doing this is a complaint from Josh Berkus
      that json_to_record() produced an unintelligible error message when
      dealing with an array item, because it tries to feed the JSON-format
      array value to array_in().  Really it ought to be smart enough to
      perform JSON-to-Postgres array conversion, but that's a future feature
      not a bug fix.  In the meantime, this change is something we agreed
      we could back-patch into 9.4, and it should help de-confuse things a bit.
      475aedd1
    • Andres Freund's avatar
      Don't skip SQL backends in logical decoding for visibility computation. · 0fd38e13
      Andres Freund authored
      The logical decoding patchset introduced PROC_IN_LOGICAL_DECODING flag
      PGXACT flag, that allows such backends to be skipped when computing
      the xmin horizon/snapshots. That's fine and sensible for walsenders
      streaming out logical changes, but not at all fine for SQL backends
      doing logical decoding. If the latter set that flag any change they
      have performed outside of logical decoding will not be regarded as
      visible - which e.g. can lead to that change being vacuumed away.
      
      Note that not setting the flag for SQL backends isn't particularly
      bothersome - the SQL backend doesn't do streaming, so it only runs for
      a limited amount of time.
      
      Per buildfarm member 'tick' and Alvaro.
      
      Backpatch to 9.4, where logical decoding was introduced.
      0fd38e13
    • Tom Lane's avatar
      Fix JSON aggregates to work properly when final function is re-executed. · 75ef4352
      Tom Lane authored
      Davide S. reported that json_agg() sometimes produced multiple trailing
      right brackets.  This turns out to be because json_agg_finalfn() attaches
      the final right bracket, and was doing so by modifying the aggregate state
      in-place.  That's verboten, though unfortunately it seems there's no way
      for nodeAgg.c to check for such mistakes.
      
      Fix that back to 9.3 where the broken code was introduced.  In 9.4 and
      HEAD, likewise fix json_object_agg(), which had copied the erroneous logic.
      Make some cosmetic cleanups as well.
      75ef4352
    • Tom Lane's avatar
      Minor cleanup of function declarations for BRIN. · 1511521a
      Tom Lane authored
      Get rid of PG_FUNCTION_INFO_V1() macros, which are quite inappropriate
      for built-in functions (possibly leftovers from testing as a loadable
      module?).  Also, fix gratuitous inconsistency between SQL-level and
      C-level names of the minmax support functions.
      1511521a
    • Alvaro Herrera's avatar
      pageinspect/BRIN: minor tweaks · b52cb469
      Alvaro Herrera authored
      Michael Paquier
      
      Double-dash additions suggested by Peter Geoghegan
      b52cb469
    • Alvaro Herrera's avatar
      dummy_seclabel: add sql/, expected/, and .gitignores · 33256243
      Alvaro Herrera authored
      Michael Paquier
      33256243
  5. 01 Dec, 2014 6 commits
    • Tom Lane's avatar
      Guard against bad "dscale" values in numeric_recv(). · 0927bf80
      Tom Lane authored
      We were not checking to see if the supplied dscale was valid for the given
      digit array when receiving binary-format numeric values.  While dscale can
      validly be more than the number of nonzero fractional digits, it shouldn't
      be less; that case causes fractional digits to be hidden on display even
      though they're there and participate in arithmetic.
      
      Bug #12053 from Tommaso Sala indicates that there's at least one broken
      client library out there that sometimes supplies an incorrect dscale value,
      leading to strange behavior.  This suggests that simply throwing an error
      might not be the best response; it would lead to failures in applications
      that might seem to be working fine today.  What seems the least risky fix
      is to truncate away any digits that would be hidden by dscale.  This
      preserves the existing behavior in terms of what will be printed for the
      transmitted value, while preventing subsequent arithmetic from producing
      results inconsistent with that.
      
      In passing, throw a specific error for the case of dscale being outside
      the range that will fit into a numeric's header.  Before you got "value
      overflows numeric format", which is a bit misleading.
      
      Back-patch to all supported branches.
      0927bf80
    • Alvaro Herrera's avatar
      Move security_label test · df761e3c
      Alvaro Herrera authored
      Rather than have the core security_label regression test depend on the
      dummy_seclabel module, have that part of the test be executed by
      dummy_seclabel itself directly.  This simplifies the testing rig a bit;
      in particular it should silence the problems from the MSVC buildfarm
      phylum, which haven't yet gotten taught how to install src/test/modules.
      df761e3c
    • Andrew Dunstan's avatar
      Fix hstore_to_json_loose's detection of valid JSON number values. · e09996ff
      Andrew Dunstan authored
      We expose a function IsValidJsonNumber that internally calls the lexer
      for json numbers. That allows us to use the same test everywhere,
      instead of inventing a broken test for hstore conversions. The new
      function is also used in datum_to_json, replacing the code that is now
      moved to the new function.
      
      Backpatch to 9.3 where hstore_to_json_loose was introduced.
      e09996ff
    • Heikki Linnakangas's avatar
      Put SSL_pending() call behind the new internal SSL API. · 4e86f1b1
      Heikki Linnakangas authored
      It seems likely that any SSL implementation will need a similar call, not
      just OpenSSL.
      4e86f1b1
    • Magnus Hagander's avatar
      Fix missing space in documentation · 6d6cade0
      Magnus Hagander authored
      Ian Barwick
      6d6cade0
    • Tom Lane's avatar
      Add a #define for the inet overlaps operator. · 866737c9
      Tom Lane authored
      Extracted from pending inet selectivity patch.  The rest of it isn't
      quite ready to commit, but we might as well push this part so the patch
      doesn't have to track the moving target of pg_operator.h.
      866737c9
  6. 30 Nov, 2014 2 commits
    • Tom Lane's avatar
      Fix minor bugs in commit 30bf4689 et al. · 1adbb347
      Tom Lane authored
      Coverity complained that the "else" added to fillPGconn() was unreachable,
      which it was.  Remove the dead code.  In passing, rearrange the tests so as
      not to bother trying to fetch values for options that can't be assigned.
      
      Pre-9.3 did not have that issue, but it did have a "return" that should be
      "goto oom_error" to ensure that a suitable error message gets filled in.
      1adbb347
    • Alvaro Herrera's avatar
      Move test modules from contrib to src/test/modules · 22dfd116
      Alvaro Herrera authored
      This is advance preparation for introducing even more test modules; the
      easy solution is to add them to contrib, but that's bloated enough that
      it seems a good time to think of something different.
      
      Moved modules are dummy_seclabel, test_shm_mq, test_parser and
      worker_spi.
      
      (test_decoding was also a candidate, but there was too much opposition
      to moving that one.  We can always reconsider later.)
      22dfd116
  7. 29 Nov, 2014 3 commits
  8. 28 Nov, 2014 5 commits
    • Alvaro Herrera's avatar
      Fix BRIN operator family definitions · 816e10d8
      Alvaro Herrera authored
      The original definitions were leaving no room for cross-type operators,
      so queries that compared a column of one type against something of a
      different type were not taking advantage of the index.  Fix by making
      the opfamilies more like the ones for Btree, and include a few
      cross-type operator classes.
      
      Catalog version bumped.
      
      Per complaints from Hubert Lubaczewski, Mark Wong, Heikki Linnakangas.
      816e10d8
    • Alvaro Herrera's avatar
      Update transaction README for persistent multixacts · ae04bf50
      Alvaro Herrera authored
      Multixacts are now maintained during recovery, but the README didn't get
      the memo.  Backpatch to 9.3, where the divergence was introduced.
      ae04bf50
    • Tom Lane's avatar
      Add bms_get_singleton_member(), and use it where appropriate. · d25367ec
      Tom Lane authored
      This patch adds a function that replaces a bms_membership() test followed
      by a bms_singleton_member() call, performing both the test and the
      extraction of a singleton set's member in one scan of the bitmapset.
      The performance advantage over the old way is probably minimal in current
      usage, but it seems worthwhile on notational grounds anyway.
      
      David Rowley
      d25367ec
    • Tom Lane's avatar
      Add bms_next_member(), and use it where appropriate. · f4e031c6
      Tom Lane authored
      This patch adds a way of iterating through the members of a bitmapset
      nondestructively, unlike the old way with bms_first_member().  While
      bms_next_member() is very slightly slower than bms_first_member()
      (at least for typical-size bitmapsets), eliminating the need to palloc
      and pfree a temporary copy of the target bitmapset is a significant win.
      So this method should be preferred in all cases where a temporary copy
      would be necessary.
      
      Tom Lane, with suggestions from Dean Rasheed and David Rowley
      f4e031c6
    • Tom Lane's avatar
      Improve performance of OverrideSearchPathMatchesCurrent(). · 96d66bcf
      Tom Lane authored
      This function was initially coded on the assumption that it would not be
      performance-critical, but that turns out to be wrong in workloads that
      are heavily dependent on the speed of plpgsql functions.  Speed it up by
      hard-coding the comparison rules, thereby avoiding palloc/pfree traffic
      from creating and immediately freeing an OverrideSearchPath object.
      Per report from Scott Marlowe.
      96d66bcf