1. 12 12月, 2014 3 次提交
    • T
      Make rowsecurity test clean up after itself, too. · 08452646
      Tom Lane 提交于
      Leaving global objects like roles hanging around is bad practice.
      08452646
    • T
      Fix completely broken REINDEX SCHEMA testcase. · 58af84f4
      Tom Lane 提交于
      Aside from not testing the case it claimed to test (namely a permissions
      failure), it left a login-capable role lying around, which quite aside
      from possibly being a security hole would cause subsequent regression runs
      to fail since the role would already exist.
      58af84f4
    • T
      Fix assorted confusion between Oid and int32. · 06d5803f
      Tom Lane 提交于
      In passing, also make some debugging elog's in pgstat.c a bit more
      consistently worded.
      
      Back-patch as far as applicable (9.3 or 9.4; none of these mistakes are
      really old).
      
      Mark Dilger identified and patched the type violations; the message
      rewordings are mine.
      06d5803f
  2. 11 12月, 2014 3 次提交
    • H
      Use correct macro for reltablespace. · 10eb7dfa
      Heikki Linnakangas 提交于
      It's an OID. WRITE_UINT_FIELD is identical to WRITE_OID_FIELD, but let's
      be tidy.
      
      Mark Dilger
      10eb7dfa
    • P
      Fix typo · 7442a889
      Peter Eisentraut 提交于
      Author: Fabrízio de Royes Mello <fabriziomello@gmail.com>
      7442a889
    • T
      Fix minor thinko in convertToJsonb(). · 24688f4e
      Tom Lane 提交于
      The amount of space to reserve for the value's varlena header is
      VARHDRSZ, not sizeof(VARHDRSZ).  The latter coding accidentally
      failed to fail because of the way the VARHDRSZ macro is currently
      defined; but if we ever change it to return size_t (as one might
      reasonably expect it to do), convertToJsonb() would have failed.
      
      Spotted by Mark Dilger.
      24688f4e
  3. 09 12月, 2014 4 次提交
  4. 08 12月, 2014 6 次提交
    • S
      REINDEX SCHEMA · fe263d11
      Simon Riggs 提交于
      Add new SCHEMA option to REINDEX and reindexdb.
      
      Sawada Masahiko
      
      Reviewed by Michael Paquier and Fabrízio de Royes Mello
      fe263d11
    • S
      Windows: use GetSystemTimePreciseAsFileTime if available · 8001fe67
      Simon Riggs 提交于
      PostgreSQL on Windows 8 or Windows Server 2012 will now
      get high-resolution timestamps by dynamically loading the
      GetSystemTimePreciseAsFileTime function. It'll fall back to
      to GetSystemTimeAsFileTime if the higher precision variant
      isn't found, so the same binaries without problems on older
      Windows releases.
      
      No attempt is made to detect the Windows version.  Only the
      presence or absence of the desired function is considered.
      
      Craig Ringer
      8001fe67
    • S
      Use GetSystemTimeAsFileTime directly in win32 · 519b0757
      Simon Riggs 提交于
      PostgreSQL was calling GetSystemTime followed by SystemTimeToFileTime in the
      win32 port gettimeofday function. This is not necessary and limits the reported
      precision to the 1ms granularity that the SYSTEMTIME struct can represent. By
      using GetSystemTimeAsFileTime we avoid unnecessary conversions and capture
      timestamps at 100ns granularity, which is then rounded to 1µs granularity for
      storage in a PostgreSQL timestamp.
      
      On most Windows systems this change will actually have no significant effect on
      timestamp resolution as the system timer tick is typically between 1ms and 15ms
      depending on what timer resolution currently running applications have
      requested. You can check this with clockres.exe from sysinternals. Despite the
      platform limiation this change still permits capture of finer timestamps where
      the system is capable of producing them and it gets rid of an unnecessary
      syscall.
      
      The higher resolution GetSystemTimePreciseAsFileTime call available on Windows
      8 and Windows Server 2012 has the same interface as GetSystemTimeAsFileTime, so
      switching to GetSystemTimeAsFileTime makes it easier to use the Precise variant
      later.
      
      Craig Ringer, reviewed by David Rowley
      519b0757
    • P
      doc: Fix DocBook table column count declaration · 611d46ea
      Peter Eisentraut 提交于
      This was broken in 618c9430.
      611d46ea
    • S
      Correct recovery_target_action docs · da71632f
      Simon Riggs 提交于
      From Michael Paquier
      da71632f
    • S
      Remove duplicate code in heap_prune_chain() · c2707547
      Simon Riggs 提交于
      No need to set tuple tableOid twice
      
      Jim Nasby
      c2707547
  5. 07 12月, 2014 2 次提交
    • S
      Event Trigger for table_rewrite · 618c9430
      Simon Riggs 提交于
      Generate a table_rewrite event when ALTER TABLE
      attempts to rewrite a table. Provide helper
      functions to identify table and reason.
      
      Intended use case is to help assess or to react
      to schema changes that might hold exclusive locks
      for long periods.
      
      Dimitri Fontaine, triggering an edit by Simon Riggs
      
      Reviewed in detail by Michael Paquier
      618c9430
    • S
      Tweaks for recovery_target_action · b8e33a85
      Simon Riggs 提交于
      Rename parameter action_at_recovery_target to
      recovery_target_action suggested by Christoph Berg.
      
      Place into recovery.conf suggested by Fujii Masao,
      replacing (deprecating) earlier parameters, per
      Michael Paquier.
      b8e33a85
  6. 05 12月, 2014 9 次提交
  7. 04 12月, 2014 5 次提交
    • P
      Revert haphazard pgxs makefile changes · e4b5a070
      Peter Eisentraut 提交于
      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
    • P
      Remove USE_VPATH make variable from PGXS · eb1c3f47
      Peter Eisentraut 提交于
      The user can just set VPATH directly.  There is no need to invent
      another variable.
      eb1c3f47
    • P
      Fix SHLIB_PREREQS use in contrib, allowing PGXS builds · 1e95bbc8
      Peter Eisentraut 提交于
      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
    • P
      Move PG_AUTOCONF_FILENAME definition · e86507d7
      Peter Eisentraut 提交于
      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
    • A
      doc: Fix markup · 182362b6
      Alvaro Herrera 提交于
      In the spirit of d34b48a0
      
      Per buildfarm member guaibasaurus, via Stefan Kaltenbrunner.
      182362b6
  8. 03 12月, 2014 8 次提交
    • A
      Keep track of transaction commit timestamps · 73c986ad
      Alvaro Herrera 提交于
      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
    • A
      Fix typos · 6597ec9b
      Alvaro Herrera 提交于
      6597ec9b
    • P
      Fix whitespace · bc2f43ea
      Peter Eisentraut 提交于
      bc2f43ea
    • A
      Install kludges to fix check-world for src/test/modules · da34731b
      Alvaro Herrera 提交于
      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
    • T
      Improve error messages for malformed array input strings. · 475aedd1
      Tom Lane 提交于
      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
    • A
      Don't skip SQL backends in logical decoding for visibility computation. · 0fd38e13
      Andres Freund 提交于
      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
    • T
      Fix JSON aggregates to work properly when final function is re-executed. · 75ef4352
      Tom Lane 提交于
      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
    • T
      Minor cleanup of function declarations for BRIN. · 1511521a
      Tom Lane 提交于
      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