1. 05 3月, 2016 1 次提交
  2. 04 3月, 2016 7 次提交
    • P
      Add prerequisite for KOI8-U.TXT · 1fa2a6b1
      Peter Eisentraut 提交于
      This was missed when the encoding was added.
      1fa2a6b1
    • P
      Make some adjustments in variable assignments · b497abc6
      Peter Eisentraut 提交于
      These variables aren't really used for anything interesting, but it
      seems the existing grouping was somewhat nonsensical.
      b497abc6
    • P
      Add missing rules related to EUC_JIS_2004 and SHIFT_JIS_2004 encodings · 7a4a813c
      Peter Eisentraut 提交于
      This was apparently forgotten in commit
      75c6519f.
      7a4a813c
    • A
      Force synchronous_commit=on in test_decoding's concurrent_ddl_dml.spec. · 1986c3c4
      Andres Freund 提交于
      Otherwise running installcheck-force on a server with
      synchronous_commit=off will result in the tests failing. All the other
      tests already do so...
      
      Backpatch: 9.4, where logical decoding was added
      1986c3c4
    • A
      pgbench: accept unambiguous builtin prefixes for -b · d561f1ca
      Alvaro Herrera 提交于
      This makes it easier to use "-b se" instead of typing the full "-b
      select-only".
      
      Author: Fabien Coelho
      Reviewed-by: Michaël Paquier
      d561f1ca
    • A
      Rework PostgresNode's psql method · 2c83f435
      Alvaro Herrera 提交于
      This makes the psql() method much more capable: it captures both stdout
      and stderr; it now returns the psql exit code rather than stdout; a
      timeout can now be specified, as can ON_ERROR_STOP behavior; it gained a
      new "on_error_die" (defaulting to off) parameter to raise an exception
      if there's any problem.  Finally, additional parameters to psql can be
      passed if there's need for further tweaking.
      
      For convenience, a new safe_psql() method retains much of the old
      behavior of psql(), except that it uses on_error_die on, so that
      problems like syntax errors in SQL commands can be detected more easily.
      
      Many existing TAP test files now use safe_psql, which is what is really
      wanted.  A couple of ->psql() calls are now added in the commit_ts
      tests, which verify that the right thing is happening on certain errors.
      Some ->command_fails() calls in recovery tests that were verifying that
      psql failed also became ->psql() calls now.
      
      Author: Craig Ringer. Some tweaks by Álvaro Herrera
      Reviewed-By: Michaël Paquier
      2c83f435
    • A
      perltidy PostgresNode and SimpleTee · 7d9a4301
      Alvaro Herrera 提交于
      Also, mention in README that Perl files should be perltidy'ed.  This
      isn't really the best place (since we have Perl files elsewhere in the
      tree) and this is already in pgindent's README, but this subdir is
      likely to get hacked a whole lot more than the other Perl files, so it
      seems okay to spend two lines on this.
      
      Author: Craig Ringer
      7d9a4301
  3. 03 3月, 2016 10 次提交
    • A
      Fix mistakes in recovery tests · 5bec1ad4
      Alvaro Herrera 提交于
      One test was relying on method remove_tree that isn't implemented in the
      oldest Perl we support; fix it by using the older rmtree instead.
      
      Another test had a typo in a SQL command, which isn't noticed because
      the PostgresNode->psql() method doesn't check that queries return
      correctly.  That's undesirable and will also be fixed later on, but for
      now let's make the test actually work.
      
      Author: Craig Ringer
      5bec1ad4
    • S
      Revert buggy optimization of index scans · c7111d11
      Simon Riggs 提交于
      606c0123 attempted to reduce cost of index scans using > and <
      strategies, though got that completely wrong in a few complex cases.
      
      Revert whole patch until we find a safe optimization.
      c7111d11
    • M
      Add prefix to pl/pgsql global variables and functions · 6c90996a
      Magnus Hagander 提交于
      Rename pl/pgsql global variables to always have a plpgsql_ prefix,
      so they don't conflict with other shared libraries loaded.
      6c90996a
    • A
      logical decoding: fix decoding of a commit's commit time. · 7c17aac6
      Andres Freund 提交于
      When adding replication origins in 5aa23504, I somehow managed to set
      the timestamp of decoded transactions to InvalidXLogRecptr when decoding
      one made without a replication origin. Fix that, and the wrong type of
      the new commit_time variable.
      
      This didn't trigger a regression test failure because we explicitly
      don't show commit timestamps in the regression tests, as they obviously
      are variable. Add a test that checks that a decoded commit's timestamp
      is within minutes of NOW() from before the commit.
      
      Reported-By: Weiping Qu
      Diagnosed-By: Artur Zakirov
      Discussion: 56D4197E.9050706@informatik.uni-kl.de,
          56D42918.1010108@postgrespro.ru
      Backpatch: 9.5, where 5aa23504 originates.
      7c17aac6
    • T
      Fix json_to_record() bug with nested objects. · a9d199f6
      Tom Lane 提交于
      A thinko concerning nesting depth caused json_to_record() to produce bogus
      output if a field of its input object contained a sub-object with a field
      name matching one of the requested output column names.  Per bug #13996
      from Johann Visagie.
      
      I added a regression test case based on his example, plus parallel tests
      for json_to_recordset, jsonb_to_record, jsonb_to_recordset.  The latter
      three do not exhibit the same bug (which suggests that we may be missing
      some opportunities to share code...) but testing seems like a good idea
      in any case.
      
      Back-patch to 9.4 where these functions were introduced.
      a9d199f6
    • T
      Create stub functions to support pg_upgrade of old contrib/tsearch2. · eb43e851
      Tom Lane 提交于
      Commits 9ff60273 and dbe23289 adjusted the declarations
      of some core functions referenced by contrib/tsearch2's install script,
      forgetting that in a pg_upgrade situation, we'll be trying to restore
      operator class definitions that reference the old signatures.  We've
      hit this problem before; solve it in the same way as before, namely by
      installing stub functions that have the expected signature and just
      invoke the correct function.  Per report from Jeff Janes.
      
      (Someday we ought to stop supporting contrib/tsearch2, but I'm not
      sure today is that day.)
      eb43e851
    • A
      Prefix temp data dirs with the node name · cc6077d4
      Alvaro Herrera 提交于
      This makes it easier to relate the temporary data dirs to each node in
      a test script.
      
      Author: Kyotaro Horiguchi
      Reviewed-By: Craig Ringer, Alvaro Herrera
      cc6077d4
    • T
      Fix PL/Tcl's encoding conversion logic. · c8c7c93d
      Tom Lane 提交于
      PL/Tcl appears to contain logic to convert strings between the database
      encoding and UTF8, which is the only encoding modern Tcl will deal with.
      However, that code has been disabled since commit 03489512, which
      made it "#if defined(UNICODE_CONVERSION)" and neglected to provide any way
      for that symbol to become defined.  That might have been all right back
      in 2001, but these days we take a dim view of allowing strings with
      incorrect encoding into the database.
      
      Remove the conditional compilation, fix warnings about signed/unsigned char
      conversions, clean up assorted places that didn't bother with conversions.
      (Notably, there were lots of assumptions that database table and field
      names didn't need conversion...)
      
      Add a regression test based on plpython_unicode.  It's not terribly
      thorough, but better than no test at all.
      c8c7c93d
    • T
      Make PL/Tcl require Tcl 8.4 or later. · e2609323
      Tom Lane 提交于
      As of commit 28782206, PL/Tcl will not
      compile against pre-8.0 Tcl, whereas it used to work (more or less anyway)
      with quite prehistoric versions.  As long as we're moving these goalposts,
      let's reinstall them at someplace that has some thought behind it.  This
      commit sets the minimum allowed Tcl version at 8.4, and rips out some bits
      of compatibility cruft that are in consequence no longer needed.  Reasons
      for requiring 8.4 include:
      
      * 8.4 was released in 2002; there seems little reason to believe that
      anyone would want to use older versions with Postgres 9.6+.
      
      * We have no buildfarm members testing anything older than 8.4, and
      thus no way to know if it's broken.
      
      * We need at least 8.1 to allow enforcement of database encoding
      security (8.1 standardized Tcl on using UTF8 internally, before that
      it was pretty unpredictable).
      
      * Some versions between 8.1 and 8.4 allowed the backend to become
      multithreaded, which is disastrous.  We need at least 8.4 to be able
      to disable the Tcl notifier subsystem to prevent that.
      
      A small side benefit is that we can make the code more readable by
      doing s/CONST84/const/g.
      e2609323
    • T
      Convert PL/Tcl to use Tcl's "object" interfaces. · 28782206
      Tom Lane 提交于
      The original implementation of Tcl was all strings, but they improved
      performance significantly by introducing typed "objects" (integers,
      lists, code, etc).  It's past time we made use of that; that happened
      in Tcl 8.0 which was released in 1997.
      
      This patch also modernizes some of the error-reporting code, which may
      cause small changes in the spelling of complaints about bad calls to
      PL/Tcl-provided commands.
      
      Jim Nasby and Karl Lehenbauer, reviewed by Victor Wagner
      28782206
  4. 02 3月, 2016 8 次提交
    • T
      Fix TAP tests for older Perls. · 3b8d7215
      Tom Lane 提交于
      Commit 7132810c (Retain tempdirs for failed tests) used Test::More's
      is_passing method, but that was added in Test::More 0.89_01 which is
      sometime later than Perl 5.10.1.  Popular platforms such as RHEL6 don't
      have that, nevermind some of our older dinosaurs.  Do it the hard way.
      
      Michael Paquier, based on research by Craig Ringer
      3b8d7215
    • R
      Change the format of the VM fork to add a second bit per page. · a892234f
      Robert Haas 提交于
      The new bit indicates whether every tuple on the page is already frozen.
      It is cleared only when the all-visible bit is cleared, and it can be
      set only when we vacuum a page and find that every tuple on that page is
      both visible to every transaction and in no need of any future
      vacuuming.
      
      A future commit will use this new bit to optimize away full-table scans
      that would otherwise be triggered by XID wraparound considerations.  A
      page which is merely all-visible must still be scanned in that case, but
      a page which is all-frozen need not be.  This commit does not attempt
      that optimization, although that optimization is the goal here.  It
      seems better to get the basic infrastructure in place first.
      
      Per discussion, it's very desirable for pg_upgrade to automatically
      migrate existing VM forks from the old format to the new format.  That,
      too, will be handled in a follow-on patch.
      
      Masahiko Sawada, reviewed by Kyotaro Horiguchi, Fujii Masao, Amit
      Kapila, Simon Riggs, Andres Freund, and others, and substantially
      revised by me.
      a892234f
    • T
      Improve coverage of pltcl regression tests. · 68c521eb
      Tom Lane 提交于
      Test composite-type arguments and the argisnull and spi_lastoid Tcl
      commmands.  This stuff was not covered before, but needs to be exercised
      since the upcoming Tcl object-conversion patch changes these code paths
      (and broke at least one of them).
      68c521eb
    • A
      Add more tests for commit_timestamp feature · 9def031b
      Alvaro Herrera 提交于
      These tests verify that 1) WAL replay preserves the stored value,
      2) a streaming standby server replays the value obtained from the
      master, and 3) the behavior is sensible in the face of repeated
      configuration changes.
      
      One annoyance is that tmp_check/ subdir from the TAP tests is clobbered
      when the pg_regress test runs in the same subdirectory.  This is
      bothersome but not too terrible a problem, since the pg_regress test is
      not run anyway if the TAP tests fail (unless "make -k" is used).
      
      I had these tests around since commit 69e7235c; add them now that we
      have the recovery test framework in place.
      9def031b
    • A
      TAP tests: retain temp dirs on test failure · 88802e06
      Alvaro Herrera 提交于
      This makes it easier to study the reason for the failure.
      
      Author: Kyotaro Horiguchi
      Reviewed-By: Craig Ringer
      88802e06
    • R
      Fix incorrect comment. · 212bba93
      Robert Haas 提交于
      PQmblen and PQdsplen return information about characters, not words.
      
      Kyotaro Horiguchi
      212bba93
    • R
      Fix mistake in extensible node code. · aec64e8f
      Robert Haas 提交于
      I believe that I (rhaas) introduced this bug while editing the patch
      that became bcac23de.
      
      Report and patch from KaiGai Kohei.
      aec64e8f
    • R
      Extend pgbench's expression syntax to support a few built-in functions. · 7e137f84
      Robert Haas 提交于
      Fabien Coelho, reviewed mostly by Michael Paquier and me, but also by
      Heikki Linnakangas, BeomYong Lee, Kyotaro Horiguchi, Oleksander
      Shulgin, and Álvaro Herrera.
      7e137f84
  5. 01 3月, 2016 9 次提交
    • P
      Add Unicode map generation scripts as rule prerequisites · bd6cf3f2
      Peter Eisentraut 提交于
      That way, the rules will trigger when the scripts change.
      bd6cf3f2
    • P
      Fix comments · cc074bf6
      Peter Eisentraut 提交于
      Some of these comments were copied and pasted without updating them,
      some of them were duplicates.
      cc074bf6
    • P
    • T
      Suppress scary-looking log messages from async-notify isolation test. · 3d523564
      Tom Lane 提交于
      I noticed that the async-notify test results in log messages like these:
      
      LOG:  could not send data to client: Broken pipe
      FATAL:  connection to client lost
      
      This is because it unceremoniously disconnects a client session that is
      about to have some NOTIFY messages delivered to it.  Such log messages
      during a regression test might well cause people to go looking for a
      problem that doesn't really exist (it did cause me to waste some time that
      way).  We can shut it up by adding an UNLISTEN command to session teardown.
      
      Patch HEAD only; this doesn't seem significant enough to back-patch.
      3d523564
    • T
      Improve error message for rejecting RETURNING clauses with dropped columns. · 8d8ff5f7
      Tom Lane 提交于
      This error message was written with only ON SELECT rules in mind, but since
      then we also made RETURNING-clause targetlists go through the same logic.
      This means that you got a rather off-topic error message if you tried to
      add a rule with RETURNING to a table having dropped columns.  Ideally we'd
      just support that, but some preliminary investigation says that it might be
      a significant amount of work.  Seeing that Nicklas Avén's complaint is the
      first one we've gotten about this in the ten years or so that the code's
      been like that, I'm unwilling to put much time into it.  Instead, improve
      the error report by issuing a different message for RETURNING cases, and
      revise the associated comment based on this investigation.
      
      Discussion: 1456176604.17219.9.camel@jordogskog.no
      8d8ff5f7
    • A
      Minor tweaks for new src/test/recovery · 5847397d
      Alvaro Herrera 提交于
      Author: Michael Paquier
      5847397d
    • A
      Fix typos · 10b48522
      Alvaro Herrera 提交于
      Author: Amit Langote
      10b48522
    • A
      doc: document MANPATH as /usr/local/pgsql/share/man · 1c7c189f
      Alvaro Herrera 提交于
      The docs were advising to use /usr/local/pgsql/man instead, but that's
      wrong.
      
      Reported-By: Slawomir Sudnik
      Backpatch-To: 9.1
      Bug: #13894
      1c7c189f
    • A
      Make new isolationtester test more stable · 54638f57
      Alvaro Herrera 提交于
      The original coding of the test was relying too much on the ordering in
      which backends are awakened once an advisory lock which they wait for is
      released.  Change the code so that each backend uses its own advisory
      lock instead, so that the output becomes stable.  Also add a few seconds
      of sleep between lock releases, so that the test isn't broken in
      overloaded buildfarm animals, as suggested by Tom Lane.
      
      Per buildfarm members spoonbill and guaibasaurus.
      
      Discussion: https://www.postgresql.org/message-id/19294.1456551587%40sss.pgh.pa.us
      54638f57
  6. 29 2月, 2016 4 次提交
    • T
      Remove useless unary plus. · c110678a
      Tom Lane 提交于
      It's harmless, but might confuse readers.  Seems to have been introduced
      in 6bc8ef0b.  Back-patch, just to avoid cosmetic cross-branch
      differences.
      
      Amit Langote
      c110678a
    • T
      Fix build under OPTIMIZER_DEBUG. · 05893712
      Tom Lane 提交于
      In commit 19a54114 I replaced RelOptInfo.width with
      RelOptInfo.reltarget.width, but I missed updating debug_print_rel()
      for that because it's not compiled by default.
      Reported by Salvador Fandino, patch by Michael Paquier.
      05893712
    • D
      Fix incorrect varlevelsup in security_barrier_replace_vars(). · 41fedc24
      Dean Rasheed 提交于
      When converting an RTE with securityQuals into a security barrier
      subquery RTE, ensure that the Vars in the new subquery's targetlist
      all have varlevelsup = 0 so that they correctly refer to the
      underlying base relation being wrapped.
      
      The original code was creating new Vars by copying them from existing
      Vars referencing the base relation found elsewhere in the query, but
      failed to account for the fact that such Vars could come from sublink
      subqueries, and hence have varlevelsup > 0. In practice it looks like
      this could only happen with nested security barrier views, where the
      outer view has a WHERE clause containing a correlated subquery, due to
      the order in which the Vars are processed.
      
      Bug: #13988
      Reported-by: Adam Guthrie
      Backpatch-to: 9.4, where updatable SB views were introduced
      41fedc24
    • T
      Avoid multiple free_struct_lconv() calls on same data. · 907e4dd2
      Tom Lane 提交于
      A failure partway through PGLC_localeconv() led to a situation where
      the next call would call free_struct_lconv() a second time, leading
      to free() on already-freed strings, typically leading to a core dump.
      Add a flag to remember whether we need to do that.
      
      Per report from Thom Brown.  His example case only provokes the failure
      as far back as 9.4, but nonetheless this code is obviously broken, so
      back-patch to all supported branches.
      907e4dd2
  7. 28 2月, 2016 1 次提交