1. 30 Mar, 2013 1 commit
    • Peter Eisentraut's avatar
      ecpg: Parallel make fix · 602070f9
      Peter Eisentraut authored
      In some parallel make situations, the install-headers target could be
      called before the installation directories are created by installdirs,
      causing the installation to fail.  Fix that by making install-headers
      depend on installdirs.
      602070f9
  2. 29 Mar, 2013 5 commits
    • Andrew Dunstan's avatar
      6caf759f
    • Andrew Dunstan's avatar
      Add new JSON processing functions and parser API. · a570c98d
      Andrew Dunstan authored
      The JSON parser is converted into a recursive descent parser, and
      exposed for use by other modules such as extensions. The API provides
      hooks for all the significant parser event such as the beginning and end
      of objects and arrays, and providing functions to handle these hooks
      allows for fairly simple construction of a wide variety of JSON
      processing functions. A set of new basic processing functions and
      operators is also added, which use this API, including operations to
      extract array elements, object fields, get the length of arrays and the
      set of keys of a field, deconstruct an object into a set of key/value
      pairs, and create records from JSON objects and arrays of objects.
      
      Catalog version bumped.
      
      Andrew Dunstan, with some documentation assistance from Merlin Moncure.
      a570c98d
    • Tom Lane's avatar
      Document encode(bytea, 'escape')'s behavior correctly. · 9ad27c21
      Tom Lane authored
      I changed this in commit fd15dba5, but
      missed the fact that the SGML documentation of the function specified
      exactly what it did.  Well, one of the two places where it's specified
      documented that --- probably I looked at the other place and thought
      nothing needed to be done.  Sync the two places where encode() and
      decode() are described.
      9ad27c21
    • Tom Lane's avatar
      Must check indisready not just indisvalid when dumping from 9.2 server. · aa02864f
      Tom Lane authored
      9.2 uses a kluge representation of "indislive"; we have to account for
      that when examining pg_index.  Simplest solution is to check indisready
      for 9.0 and 9.1 as well; that's harmless though unnecessary, so it's
      not worth making a version distinction for.
      
      Fixes oversight in commit 683abc73,
      as noted by Andres Freund.
      aa02864f
    • Tom Lane's avatar
      Draft release notes for 9.2.4, 9.1.9, 9.0.13, 8.4.17. · 29505a89
      Tom Lane authored
      Covers commits through today.  Not back-patching into back branches
      yet, since this is just for people to review in advance.
      29505a89
  3. 28 Mar, 2013 7 commits
    • Robert Haas's avatar
      sepgsql: Documentation improvements. · 2a3db8ce
      Robert Haas authored
      Fixes by me, per griping by Thom Brown.
      2a3db8ce
    • Robert Haas's avatar
      Allow sepgsql labels to depend on object name. · 0f05840b
      Robert Haas authored
      The main change here is to call security_compute_create_name_raw()
      rather than security_compute_create_raw().  This ups the minimum
      requirement for libselinux from 2.0.99 to 2.1.10, but it looks
      like most distributions will have picked that up before 9.3 is out.
      
      KaiGai Kohei
      0f05840b
    • Tom Lane's avatar
      Update time zone data files to tzdata release 2013b. · ae7f1c3e
      Tom Lane authored
      DST law changes in Chile, Haiti, Morocco, Paraguay, some Russian areas.
      Historical corrections for numerous places.
      ae7f1c3e
    • Tom Lane's avatar
      Avoid "variable might be clobbered by longjmp" warning. · 58bc4817
      Tom Lane authored
      On older-model gcc, the original coding of UTILITY_BEGIN_QUERY() can
      draw this error because of multiple assignments to _needCleanup.
      Rather than mark that variable volatile, we can suppress the warning
      by arranging to have just one unconditional assignment before PG_TRY.
      58bc4817
    • Alvaro Herrera's avatar
      Add sql_drop event for event triggers · 473ab40c
      Alvaro Herrera authored
      This event takes place just before ddl_command_end, and is fired if and
      only if at least one object has been dropped by the command.  (For
      instance, DROP TABLE IF EXISTS of a table that does not in fact exist
      will not lead to such a trigger firing).  Commands that drop multiple
      objects (such as DROP SCHEMA or DROP OWNED BY) will cause a single event
      to fire.  Some firings might be surprising, such as
      ALTER TABLE DROP COLUMN.
      
      The trigger is fired after the drop has taken place, because that has
      been deemed the safest design, to avoid exposing possibly-inconsistent
      internal state (system catalogs as well as current transaction) to the
      user function code.  This means that careful tracking of object
      identification is required during the object removal phase.
      
      Like other currently existing events, there is support for tag
      filtering.
      
      To support the new event, add a new pg_event_trigger_dropped_objects()
      set-returning function, which returns a set of rows comprising the
      objects affected by the command.  This is to be used within the user
      function code, and is mostly modelled after the recently introduced
      pg_identify_object() function.
      
      Catalog version bumped due to the new function.
      
      Dimitri Fontaine and Álvaro Herrera
      Review by Robert Haas, Tom Lane
      473ab40c
    • Simon Riggs's avatar
      Revoke bc5334d8 · 593c39d1
      Simon Riggs authored
      593c39d1
    • Simon Riggs's avatar
      Revoke 7a5a59d3 · d139a5e2
      Simon Riggs authored
      d139a5e2
  4. 27 Mar, 2013 7 commits
    • Tom Lane's avatar
      Reset OpenSSL randomness state in each postmaster child process. · 0d1ecd63
      Tom Lane authored
      Previously, if the postmaster initialized OpenSSL's PRNG (which it will do
      when ssl=on in postgresql.conf), the same pseudo-random state would be
      inherited by each forked child process.  The problem is masked to a
      considerable extent if the incoming connection uses SSL encryption, but
      when it does not, identical pseudo-random state is made available to
      functions like contrib/pgcrypto.  The process's PID does get mixed into any
      requested random output, but on most systems that still only results in 32K
      or so distinct random sequences available across all Postgres sessions.
      This might allow an attacker who has database access to guess the results
      of "secure" operations happening in another session.
      
      To fix, forcibly reset the PRNG after fork().  Each child process that has
      need for random numbers from OpenSSL's generator will thereby be forced to
      go through OpenSSL's normal initialization sequence, which should provide
      much greater variability of the sequences.  There are other ways we might
      do this that would be slightly cheaper, but this approach seems the most
      future-proof against SSL-related code changes.
      
      This has been assigned CVE-2013-1900, but since the issue and the patch
      have already been publicized on pgsql-hackers, there's no point in trying
      to hide this commit.
      
      Back-patch to all supported branches.
      
      Marko Kreen
      0d1ecd63
    • Kevin Grittner's avatar
      Fix pasto which broke docs build. · 40e873d8
      Kevin Grittner authored
      Commit bc5334d8 accidentally
      included a second <variablelist> tag for a new list item.
      40e873d8
    • Heikki Linnakangas's avatar
      Fix buffer pin leak in heap update redo routine. · 3cfb572d
      Heikki Linnakangas authored
      In a heap update, if the old and new tuple were on different pages, and the
      new page no longer existed (because it was subsequently truncated away by
      vacuum), heap_xlog_update forgot to release the pin on the old buffer. This
      bug was introduced by the "Fix multiple problems in WAL replay" patch,
      commit 3bbf668d (on master branch).
      
      With full_page_writes=off, this triggered an "incorrect local pin count"
      error later in replay, if the old page was vacuumed.
      
      This fixes bug #7969, reported by Yunong Xiao. Backpatch to 9.0, like the
      commit that introduced this bug.
      3cfb572d
    • Simon Riggs's avatar
      Set recovery_config_directory for EXEC_BACKEND. · 7a5a59d3
      Simon Riggs authored
      Remove comment questioning whether this is necessary for DataDir.
      From buildfarm failures on Windows.
      7a5a59d3
    • Heikki Linnakangas's avatar
      Move some pg_dump function around. · 7800a712
      Heikki Linnakangas authored
      Move functions used only by pg_dump and pg_restore from dumputils.c to a new
      file, pg_backup_utils.c. dumputils.c is linked into psql and some programs
      in bin/scripts, so it seems good to keep it slim. The parallel functionality
      is moved to parallel.c, as is exit_horribly, because the interesting code in
      exit_horribly is parallel-related.
      
      This refactoring gets rid of the on_exit_msg_func function pointer. It was
      problematic, because a modern gcc version with -Wmissing-format-attribute
      complained if it wasn't marked with PF_PRINTF_ATTRIBUTE, but the ancient gcc
      version that Tom Lane's old HP-UX box has didn't accept that attribute on a
      function pointer, and gave an error. We still use a similar function pointer
      trick for getLocalPQBuffer() function, to use a thread-local version of that
      in parallel mode on Windows, but that dodges the problem because it doesn't
      take printf-like arguments.
      7800a712
    • Robert Haas's avatar
      sepgsql: Support for new post-ALTER access hook. · 1cea9bbb
      Robert Haas authored
      KaiGai Kohei
      1cea9bbb
    • Simon Riggs's avatar
      Allow external recovery_config_directory · bc5334d8
      Simon Riggs authored
      If required, recovery.conf can now be located outside of the data directory.
      Server needs read/write permissions on this directory.
      bc5334d8
  5. 26 Mar, 2013 5 commits
  6. 25 Mar, 2013 4 commits
    • Heikki Linnakangas's avatar
      In base backup, only include our own tablespace version directory. · 28ba2609
      Heikki Linnakangas authored
      If you have clusters of different versions pointing to the same tablespace
      location, we would incorrectly include all the data belonging to the other
      versions, too.
      
      Fixes bug #7986, reported by Sergey Burladyan.
      28ba2609
    • Heikki Linnakangas's avatar
      Make pg_basebackup work with pre-9.3 servers, and add server version check. · d298b50a
      Heikki Linnakangas authored
      A new 'starttli' field was added to the response of BASE_BACKUP command.
      Make pg_basebackup tolerate the case that it's missing, so that it still
      works with older servers.
      
      Add an explicit check for the server version, so that you get a nicer error
      message if you try to use it with a pre-9.1 server.
      
      The streaming protocol message format changed in 9.3, so -X stream still won't
      work with pre-9.3 servers. I added a version check to ReceiveXLogStream()
      earlier, but write that slightly differently, so that in 9.4, it will still
      work with a 9.3 server. (In 9.4, the error message needs to be adjusted to
      "9.3 or above", though). Also, if the version check fails, don't retry.
      d298b50a
    • Heikki Linnakangas's avatar
      Add PF_PRINTF_ATTRIBUTE to on_exit_msg_fmt. · ea988ee8
      Heikki Linnakangas authored
      Per warning from -Wmissing-format-attribute.
      ea988ee8
    • Heikki Linnakangas's avatar
      Add missing #include. · 4eefd0f8
      Heikki Linnakangas authored
      time(2) requires time.h.
      4eefd0f8
  7. 24 Mar, 2013 2 commits
    • Tom Lane's avatar
      Fix some unportable constructs in parallel pg_dump code. · 846681fd
      Tom Lane authored
      Didn't compile on semi-obsolete gcc, and probably not on not-gcc-at-all
      either.
      846681fd
    • Andrew Dunstan's avatar
      Add parallel pg_dump option. · 9e257a18
      Andrew Dunstan authored
      New infrastructure is added which creates a set number of workers
      (threads on Windows, forked processes on Unix). Jobs are then
      handed out to these workers by the master process as needed.
      pg_restore is adjusted to use this new infrastructure in place of the
      old setup which created a new worker for each step on the fly. Parallel
      dumps acquire a snapshot clone in order to stay consistent, if
      available.
      
      The parallel option is selected by the -j / --jobs command line
      parameter of pg_dump.
      
      Joachim Wieland, lightly editorialized by Andrew Dunstan.
      9e257a18
  8. 23 Mar, 2013 4 commits
    • Tom Lane's avatar
      Update time zone abbreviation lists for changes missed since 2006. · 3b91fe18
      Tom Lane authored
      Most (all?) of Russia has moved to what's effectively year-round daylight
      savings time, so that the "standard" zone names now mean an hour later
      than they used to.  Update that, notably changing MSK as per recent
      complaint from Sergey Konoplev, but also CHOT, GET, IRKT, KGT, KRAT,
      MAGT, NOVT, OMST, VLAT, YAKT, YEKT.  The corresponding DST abbreviations
      are presumably now obsolete, but I left them in place with their old
      definitions, just to reduce any possible breakage from this change.
      
      Also add VOLT (Europe/Volgograd), which for some reason we never had
      before, as well as MIST (Antarctica/Macquarie), and fix obsolete
      definitions of MAWT, TKT, and WST.
      3b91fe18
    • Tom Lane's avatar
      Semi-automatically detect changes in timezone abbreviations. · 69602772
      Tom Lane authored
      Add an option to zic.c to dump out all non-obsolete timezone abbreviations
      defined in the Olson database.  Comparing this list to its previous state
      will clue us in when something happens that we may need to account for in
      the tznames/ time zone abbreviation lists.  The README file's previous
      exhortation to "just grep for differences" was completely useless advice,
      in my now-considerable experience; but maybe this will be a bit more
      useful.  As a starting point I built the same list from the tzdata files
      as they existed in 2006, which is committed here as known_abbrevs.txt.
      Comparison indeed turned up quite a few changes we had neglected to account
      for, which I will commit separately.
      69602772
    • Andrew Dunstan's avatar
      Avoid renaming data directory during MSVC upgrade testing. · b7f8465c
      Andrew Dunstan authored
      This appears to cause some intermittent file system problems
      on Windows 8. Instead, set up the old data directory in its
      intended final location to start with.
      b7f8465c
    • Tom Lane's avatar
      Don't put <indexterm> before <term> in <varlistentry> items. · cdc67938
      Tom Lane authored
      Doing that results in a broken index entry in PDF output.  We had only
      a few like that, which is probably why nobody noticed before.
      Standardize on putting the <term> first.
      
      Josh Kupershmidt
      cdc67938
  9. 22 Mar, 2013 5 commits
    • Tom Lane's avatar
      Document cross-version compatibility issues for contrib/postgres_fdw. · 5b86fedf
      Tom Lane authored
      One of the use-cases for postgres_fdw is extracting data from older PG
      servers, so cross-version compatibility is important.  Document what we
      can do here, and further annotate some of the coding choices that create
      compatibility constraints.  In passing, remove one unnecessary
      incompatibility with old servers, namely assuming that we didn't need to
      quote the timezone name 'UTC'.
      5b86fedf
    • Tom Lane's avatar
      Fix contrib/dblink to handle inconsistent DateStyle/IntervalStyle safely. · 8a3b6772
      Tom Lane authored
      If the remote database's settings of these GUCs are different from ours,
      ambiguous datetime values may be read incorrectly.  To fix, temporarily
      adopt the remote server's settings while we ingest a query result.
      
      This is not a complete fix, since it doesn't do anything about ambiguous
      values in commands sent to the remote server; but there seems little we
      can do about that end of it given dblink's entirely textual API for
      transmitted commands.
      
      Back-patch to 9.2.  The hazard exists in all versions, but this patch
      would need more work to apply before 9.2.  Given the lack of field
      complaints about this issue, it doesn't seem worth the effort at present.
      
      Daniel Farina and Tom Lane
      8a3b6772
    • Kevin Grittner's avatar
      Fix problems with incomplete attempt to prohibit OIDS with MVs. · 549dae03
      Kevin Grittner authored
      Problem with assertion failure in restoring from pg_dump output
      reported by Joachim Wieland.
      
      Review and suggestions by Tom Lane and Robert Haas.
      549dae03
    • Tom Lane's avatar
      Suppress uninitialized-variable warning in new checksum code. · 4912385b
      Tom Lane authored
      Some compilers understand that this coding is safe, and some don't.
      4912385b
    • Tom Lane's avatar
      Update commit_delay documentation. · 82b945c0
      Tom Lane authored
      Commit 13fe298c changed this GUC to be
      PGC_SUSET, but neglected to update the documentation to match.
      
      While at it, edit and rearrange the text a little for clarity.
      82b945c0