1. 22 Aug, 2014 5 commits
    • Tom Lane's avatar
      Fix corner-case behaviors in JSON/JSONB field extraction operators. · 41dd50e8
      Tom Lane authored
      Cause the path extraction operators to return their lefthand input,
      not NULL, if the path array has no elements.  This seems more consistent
      since the case ought to correspond to applying the simple extraction
      operator (->) zero times.
      
      Cause other corner cases in field/element/path extraction to return NULL
      rather than failing.  This behavior is arguably more useful than throwing
      an error, since it allows an expression index using these operators to be
      built even when not all values in the column are suitable for the
      extraction being indexed.  Moreover, we already had multiple
      inconsistencies between the path extraction operators and the simple
      extraction operators, as well as inconsistencies between the JSON and
      JSONB code paths.  Adopt a uniform rule of returning NULL rather than
      throwing an error when the JSON input does not have a structure that
      permits the request to be satisfied.
      
      Back-patch to 9.4.  Update the release notes to list this as a behavior
      change since 9.3.
      41dd50e8
    • Andres Freund's avatar
      Fix newly introduced misspelling of existence in pg_buffercache. · ebf20f65
      Andres Freund authored
      Peter Geoghegan
      ebf20f65
    • Heikki Linnakangas's avatar
      Fix comment in pg_basebackup. · 2af93640
      Heikki Linnakangas authored
      The option is called --tablespace-mapping, not --tablespace.
      
      Amit Kapila
      2af93640
    • Heikki Linnakangas's avatar
      Change the way pg_basebackup's tablespace mapping is implemented. · 8d938eb0
      Heikki Linnakangas authored
      Previously, we would first create the symlinks the way they are in the
      original system, and at the end replace them with the mapped symlinks.
      That never really made much sense, so now we create the symlink pointing
      to the correct location to begin with, so that there's no need to fix
      them at the end.
      
      The old coding didn't work correctly on Windows, because Windows junction
      points look more like directories than files, and ought to be removed with
      rmdir rather than unlink. Also, it incorrectly used "%d" rather than "%u"
      to print an Oid, but that's gone now.
      
      Report and patch by Amit Kapila, with minor changes by me. Reviewed by
      MauMau. Backpatch to 9.4, where the --tablespace feature was added.
      8d938eb0
    • Peter Eisentraut's avatar
      Fix whitespace · 3feda1bc
      Peter Eisentraut authored
      3feda1bc
  2. 21 Aug, 2014 3 commits
    • Stephen Frost's avatar
      Rework 'MOVE ALL' to 'ALTER .. ALL IN TABLESPACE' · 3c4cf080
      Stephen Frost authored
      As 'ALTER TABLESPACE .. MOVE ALL' really didn't change the tablespace
      but instead changed objects inside tablespaces, it made sense to
      rework the syntax and supporting functions to operate under the
      'ALTER (TABLE|INDEX|MATERIALIZED VIEW)' syntax and to be in
      tablecmds.c.
      
      Pointed out by Alvaro, who also suggested the new syntax.
      
      Back-patch to 9.4.
      3c4cf080
    • Andres Freund's avatar
      Add pinning_backends column to the pg_buffercache extension. · f5779198
      Andres Freund authored
      The new column shows how many backends have a buffer pinned. That can
      be useful during development or to diagnose production issues
      e.g. caused by vacuum waiting for cleanup locks.
      
      To handle upgrades transparently - the extension might be used in
      views - deal with callers expecting the old number of columns.
      
      Reviewed by Fujii Masao and Rajeev rastogi.
      f5779198
    • Heikki Linnakangas's avatar
      Add #define INT64_MODIFIER for the printf length modifier for 64-bit ints. · ce486056
      Heikki Linnakangas authored
      We have had INT64_FORMAT and UINT64_FORMAT for a long time, but that's not
      good enough if you want something more exotic, like "%20lld".
      
      Abhijit Menon-Sen, per Andres Freund's suggestion.
      ce486056
  3. 20 Aug, 2014 4 commits
    • Tom Lane's avatar
      More regression test cases for json/jsonb extraction operators. · fa069822
      Tom Lane authored
      Cover some cases I omitted before, such as null and empty-string
      elements in the path array.  This exposes another inconsistency:
      json_extract_path complains about empty path elements but
      jsonb_extract_path does not.
      fa069822
    • Tom Lane's avatar
      Fix core dump in jsonb #> operator, and add regression test cases. · 9bac6602
      Tom Lane authored
      jsonb's #> operator segfaulted (dereferencing a null pointer) if the RHS
      was a zero-length array, as reported in bug #11207 from Justin Van Winkle.
      json's #> operator returns NULL in such cases, so for the moment let's
      make jsonb act likewise.
      
      Also add a bunch of regression test queries memorializing the -> and #>
      operators' behavior for this and other corner cases.
      
      There is a good argument for changing some of these behaviors, as they
      are not very consistent with each other, and throwing an error isn't
      necessarily a desirable behavior for operators that are likely to be
      used in indexes.  However, everybody can agree that a core dump is the
      Wrong Thing, and we need test cases even if we decide to change their
      expected output later.
      9bac6602
    • Bruce Momjian's avatar
      pg_upgrade: adjust logging to use QUERY_ALLOC lengths · 7567d949
      Bruce Momjian authored
      Allows the logging to print the entire text of failed queries, rather
      than a truncated version.
      7567d949
    • Heikki Linnakangas's avatar
      Use comma+space as the separator in the default search_path. · 02587dcd
      Heikki Linnakangas authored
      While the space is optional, it seems nicer to be consistent with what
      you get if you do "SET search_path=...". SET always normalizes the
      separator to be comma+space.
      
      Christoph Martin
      02587dcd
  4. 19 Aug, 2014 7 commits
    • Fujii Masao's avatar
      Revert "Fix bug in checking of IDENTIFY_SYSTEM result." · c4762886
      Fujii Masao authored
      This reverts commit 083d29c6.
      
      The commit changed the code so that it causes an errors when
      IDENTIFY_SYSTEM returns three columns. But which prevents us
      from using the replication-related utilities against the server
      with older version. This is not what we want. For that
      compatibility, we allow the utilities to receive three columns
      as the result of IDENTIFY_SYSTEM eventhough it actually returns
      four columns in 9.4 or later.
      
      Pointed out by Andres Freund.
      c4762886
    • Fujii Masao's avatar
      Fix bug in checking of IDENTIFY_SYSTEM result. · 083d29c6
      Fujii Masao authored
      5a991ef8 added new column into
      the result of IDENTIFY_SYSTEM command. But it was not reflected into
      several codes checking that result. Specifically though the number of
      columns in the result was increased to 4, it was still compared with 3
      in some replication codes.
      
      Back-patch to 9.4 where the number of columns in IDENTIFY_SYSTEM
      result was increased.
      
      Report from Michael Paquier
      083d29c6
    • Noah Misch's avatar
      Install libpq DLL with $(INSTALL_SHLIB). · 8605bc75
      Noah Misch authored
      Programs need execute permission on a DLL file to load it.  MSYS
      "install" ignores the mode argument, and our Cygwin build statically
      links libpq into programs.  That explains the lack of buildfarm trouble.
      Back-patch to 9.0 (all supported versions).
      8605bc75
    • Noah Misch's avatar
      Finish adding file version information to installed Windows binaries. · ee9569e4
      Noah Misch authored
      In support of this, have the MSVC build follow GNU make in preferring
      GNUmakefile over Makefile when a directory contains both.
      
      Michael Paquier, reviewed by MauMau.
      ee9569e4
    • Noah Misch's avatar
      Replace a few strncmp() calls with strlcpy(). · fb2aece8
      Noah Misch authored
      strncmp() is a specialized API unsuited for routine copying into
      fixed-size buffers.  On a system where the length of a single filename
      can exceed MAXPGPATH, the pg_archivecleanup change prevents a simple
      crash in the subsequent strlen().  Few filesystems support names that
      long, and calling pg_archivecleanup with untrusted input is still not a
      credible use case.  Therefore, no back-patch.
      
      David Rowley
      fb2aece8
    • Noah Misch's avatar
      Make pg_service.conf sample LDIF more portable. · 7fc5f1a3
      Noah Misch authored
      The aboriginal sample placed connection parameters in
      groupOfUniqueNames/uniqueMember.  OpenLDAP, at least as early as version
      2.4.23, rejects uniqueMember entries that do not conform to the syntax
      for a distinguished name.  Use device/description, which is free-form.
      Back-patch to 9.4 for web site visibility.
      7fc5f1a3
    • Noah Misch's avatar
      Document new trigger-related forms of ALTER FOREIGN TABLE. · 10718612
      Noah Misch authored
      Oversight in commit 7cbe57c3.
      Back-patch to 9.4, where that commit first appeared.  In passing,
      release-note the FDW API postcondition change from the same commit.
      10718612
  5. 18 Aug, 2014 7 commits
  6. 17 Aug, 2014 2 commits
    • Tom Lane's avatar
      Improve DISCARD documentation. · 259904ec
      Tom Lane authored
      The new DISCARD SEQUENCES option was inadequately described, and hadn't
      been mentioned at all in the initial Description paragraph.  Rather than
      rectifying the latter the hard way, it seemed better to rewrite the
      description as a summary, instead of having it basically duplicate
      statements made under Parameters.  Be more consistent about the ordering
      of the options, too.
      259904ec
    • Peter Eisentraut's avatar
      doc: Work around stylesheet bug for man build · 1330e292
      Peter Eisentraut authored
      The upstream stylesheets for man output insert a *roff comment for an
      occurrence of an indexterm, for reasons that have apparently been lost
      in history.  This, however, is done incorrectly and causes some
      formatting problems.  This hasn't been an issue until now, but the
      reorganization of indexterm elements inside variablelists has triggered
      this issue.
      
      The upstream fix (http://sourceforge.net/p/docbook/bugs/1340/) is to
      drop indexterms altogether in man output, and so we'll do the same here.
      1330e292
  7. 16 Aug, 2014 3 commits
    • Tom Lane's avatar
      Fix bogus return macros in range_overright_internal(). · 737cdc2d
      Tom Lane authored
      PG_RETURN_BOOL() should only be used in functions following the V1 SQL
      function API.  This coding accidentally fails to fail since letting the
      compiler coerce the Datum representation of bool back to plain bool
      does give the right answer; but that doesn't make it a good idea.
      
      Back-patch to older branches just to avoid unnecessary code divergence.
      737cdc2d
    • Tom Lane's avatar
      Add opr_sanity queries to inspect commutator/negator links more closely. · a068b5b6
      Tom Lane authored
      Make lists of the names of all operators that are claimed to be commutator
      pairs or negator pairs.  This is analogous to the existing queries that
      make lists of all operator names appearing in particular opclass strategy
      slots.  Unexpected additions to these lists are likely to be mistakes; had
      we had these queries in place before, bug #11178 might've been prevented.
      a068b5b6
    • Tom Lane's avatar
      Fix bogus commutator/negator links for JSONB containment operators. · e3f9c168
      Tom Lane authored
      <@ and @> are each other's commutators, but they were incorrectly marked
      as being each other's negators instead.  (This was actually questioned
      in a comment in the original commit, but nobody followed through :-(.)
      Per bug #11178 from Christian Pronovost.
      
      In passing, fix some JSONB operator descriptions that were randomly
      different from the phrasing of every other similar description.
      
      catversion bump for pg_catalog contents change.
      e3f9c168
  8. 15 Aug, 2014 7 commits
  9. 14 Aug, 2014 2 commits