1. 08 Jun, 2013 2 commits
    • Andrew Dunstan's avatar
      Handle Unicode surrogate pairs correctly when processing JSON. · 94e3311b
      Andrew Dunstan authored
      In 9.2, Unicode escape sequences are not analysed at all other than
      to make sure that they are in the form \uXXXX. But in 9.3 many of the
      new operators and functions try to turn JSON text values into text in
      the server encoding, and this includes de-escaping Unicode escape
      sequences. This processing had not taken into account the possibility
      that this might contain a surrogate pair to designate a character
      outside the BMP. That is now handled correctly.
      
      This also enforces correct use of surrogate pairs, something that is not
      done by the type's input routines. This fact is noted in the docs.
      94e3311b
    • Peter Eisentraut's avatar
      doc: Fix <synopsis> in <term> markup · c99d5d1b
      Peter Eisentraut authored
      Although the DTD technically allows this, the resulting HTML is invalid
      because it puts block elements inside inline elements.  DocBook 5.0 also
      doesn't allow it anymore, so it's fair to assume that this was never
      really intended to work.  Replace <synopsis> with <literal>, which is
      the markup used elsewhere in the documentation in similar cases.
      c99d5d1b
  2. 07 Jun, 2013 3 commits
  3. 06 Jun, 2013 5 commits
    • Heikki Linnakangas's avatar
      Fix typo in comment. · f73cb556
      Heikki Linnakangas authored
      f73cb556
    • Robert Haas's avatar
      a6370fd9
    • Bruce Momjian's avatar
      pg_upgrade: document that --link should be used with --check · e2c84bc9
      Bruce Momjian authored
      Backpatch to 9.2.
      e2c84bc9
    • Tom Lane's avatar
      Prevent pushing down WHERE clauses into unsafe UNION/INTERSECT nests. · 964c0d0f
      Tom Lane authored
      The planner is aware that it mustn't push down upper-level quals into
      subqueries if the quals reference subquery output columns that contain
      set-returning functions or volatile functions, or are non-DISTINCT outputs
      of a DISTINCT ON subquery.  However, it missed making this check when
      there were one or more levels of UNION or INTERSECT above the dangerous
      expression.  This could lead to "set-valued function called in context that
      cannot accept a set" errors, as seen in bug #8213 from Eric Soroos, or to
      silently wrong answers in the other cases.
      
      To fix, refactor the checks so that we make the column-is-unsafe checks
      during subquery_is_pushdown_safe(), which already has to recursively
      inspect all arms of a set-operation tree.  This makes
      qual_is_pushdown_safe() considerably simpler, at the cost that we will
      spend some cycles checking output columns that possibly aren't referenced
      in any upper qual.  But the cases where this code gets executed at all
      are already nontrivial queries, so it's unlikely anybody will notice any
      slowdown of planning.
      
      This has been broken since commit 05f916e6,
      which makes the bug over ten years old.  A bit surprising nobody noticed it
      before now.
      964c0d0f
    • Peter Eisentraut's avatar
      Update SQL features list · a3bd6096
      Peter Eisentraut authored
      a3bd6096
  4. 05 Jun, 2013 1 commit
    • Tom Lane's avatar
      Put analyze_keyword back in explain_option_name production. · 3f783c88
      Tom Lane authored
      In commit 2c92edad, I broke "EXPLAIN
      (ANALYZE)" syntax, because I mistakenly thought that ANALYZE/ANALYSE were
      only partially reserved and thus would be included in NonReservedWord;
      but actually they're fully reserved so they still need to be called out
      here.
      
      A nicer solution would be to demote these words to type_func_name_keyword
      status (they can't be less than that because of "VACUUM [ANALYZE] ColId").
      While that works fine so far as the core grammar is concerned, it breaks
      ECPG's grammar for reasons I don't have time to isolate at the moment.
      So do this for the time being.
      
      Per report from Kevin Grittner.  Back-patch to 9.0, like the previous
      commit.
      3f783c88
  5. 04 Jun, 2013 4 commits
    • Tom Lane's avatar
      Provide better message when CREATE EXTENSION can't find a target schema. · 530acda4
      Tom Lane authored
      The new message (and SQLSTATE) matches the corresponding error cases in
      namespace.c.
      
      This was thought to be a "can't happen" case when extension.c was written,
      so we didn't think hard about how to report it.  But it definitely can
      happen in 9.2 and later, since we no longer require search_path to contain
      any valid schema names.  It's probably also possible in 9.1 if search_path
      came from a noninteractive source.  So, back-patch to all releases
      containing this code.
      
      Per report from Sean Chittenden, though this isn't exactly his patch.
      530acda4
    • Tom Lane's avatar
      Add ARM64 (aarch64) support to s_lock.h. · 5c7603c3
      Tom Lane authored
      Use the same gcc atomic functions as we do on newer ARM chips.
      (Basically this is a copy and paste of the __arm__ code block,
      but omitting the SWPB option since that definitely won't work.)
      
      Back-patch to 9.2.  The patch would work further back, but we'd also
      need to update config.guess/config.sub in older branches to make them
      build out-of-the-box, and there hasn't been demand for it.
      
      Mark Salter
      5c7603c3
    • Tom Lane's avatar
      Fix memory leak in LogStandbySnapshot(). · dbc6eb1f
      Tom Lane authored
      The array allocated by GetRunningTransactionLocks() needs to be pfree'd
      when we're done with it.  Otherwise we leak some memory during each
      checkpoint, if wal_level = hot_standby.  This manifests as memory bloat
      in the checkpointer process, or in bgwriter in versions before we made
      the checkpointer separate.
      
      Reported and fixed by Naoya Anzai.  Back-patch to 9.0 where the issue
      was introduced.
      
      In passing, improve comments for GetRunningTransactionLocks(), and add
      an Assert that we didn't overrun the palloc'd array.
      dbc6eb1f
    • Heikki Linnakangas's avatar
      Fix off-by-one in pg_xlogdump -r option. · 79e15c7d
      Heikki Linnakangas authored
      Because of the bug, -r would not accept the rmgr with the highest ID.
      79e15c7d
  6. 03 Jun, 2013 5 commits
    • Tom Lane's avatar
      Add semicolons to eval'd strings to hide a minor Perl behavioral change. · 035a5e1e
      Tom Lane authored
      "eval q{foo}" used to complain that the error was on line 2 of the eval'd
      string, because eval internally tacked on "\n;" so that the end of the
      erroneous command was indeed on line 2.  But as of Perl 5.18 it more
      sanely says that the error is on line 1.  To avoid Perl-version-dependent
      regression test results, use "eval q{foo;}" instead in the two places
      where this matters.  Per buildfarm.
      
      Since people might try to use newer Perl versions with older PG releases,
      back-patch as far as 9.0 where these test cases were added.
      035a5e1e
    • Heikki Linnakangas's avatar
      Put back allow_system_table_mods check in heap_create(). · 15386281
      Heikki Linnakangas authored
      This reverts commit a475c603.
      
      Erik Rijkers reported back in January 2013 that after the patch, if you do
      "pg_dump -t myschema.mytable" to dump a single table, and restore that in
      a database where myschema does not exist, the table is silently created in
      pg_catalog instead. That is because pg_dump uses
      "SET search_path=myschema, pg_catalog" to set schema the table is created
      in. While allow_system_table_mods is not a very elegant solution to this,
      we can't leave it as it is, so for now, revert it back to the way it was
      previously.
      15386281
    • Stephen Frost's avatar
      Additional spelling corrections · f129615f
      Stephen Frost authored
      A few more minor spelling corrections, no functional changes.
      
      Thom Brown
      f129615f
    • Heikki Linnakangas's avatar
      Code review of recycling WAL segments in a restartpoint. · e1e2bb34
      Heikki Linnakangas authored
      Seems cleaner to get the currently-replayed TLI in the same call to
      GetXLogReplayRecPtr that we get the WAL position. Make it more clear in the
      comment what the code does when recovery has already ended
      (RecoveryInProgress() will set ThisTimeLineID in that case). Finally, make
      resetting ThisTimeLineID afterwards more explicit.
      e1e2bb34
    • Tom Lane's avatar
      Allow type_func_name_keywords in some places where they weren't before. · 2c92edad
      Tom Lane authored
      This change makes type_func_name_keywords less reserved than they were
      before, by allowing them for role names, language names, EXPLAIN and COPY
      options, and SET values for GUCs; which are all places where few if any
      actual keywords could appear instead, so no new ambiguities are introduced.
      
      The main driver for this change is to allow "COPY ... (FORMAT BINARY)"
      to work without quoting the word "binary".  That is an inconsistency that
      has been complained of repeatedly over the years (at least by Pavel Golub,
      Kurt Lidl, and Simon Riggs); but we hadn't thought of any non-ugly solution
      until now.
      
      Back-patch to 9.0 where the COPY (FORMAT BINARY) syntax was introduced.
      2c92edad
  7. 02 Jun, 2013 2 commits
  8. 01 Jun, 2013 6 commits
  9. 31 May, 2013 3 commits
  10. 30 May, 2013 1 commit
  11. 29 May, 2013 3 commits
  12. 27 May, 2013 1 commit
    • Stephen Frost's avatar
      Documentation fix for ALTER TYPE .. RENAME · 05624220
      Stephen Frost authored
      The documentation for ALTER TYPE .. RENAME claimed to support a
      RESTRICT/CASCADE option at the 'type' level, which wasn't implemented
      and doesn't make a whole lot of sense to begin with.  What is supported,
      and previously undocumented, is
      
      ALTER TYPE .. RENAME ATTRIBUTE .. RESTRICT/CASCADE.
      
      I've updated the documentation and back-patched this to 9.1 where it was
      first introduced.
      05624220
  13. 24 May, 2013 1 commit
  14. 23 May, 2013 2 commits
    • Robert Haas's avatar
      Fix typo in comment. · 6eb971bd
      Robert Haas authored
      Pavan Deolasee
      6eb971bd
    • Heikki Linnakangas's avatar
      Print line number correctly in COPY. · e2ef2893
      Heikki Linnakangas authored
      When COPY uses the multi-insert method to insert a batch of tuples into the
      heap at a time, incorrect line number was printed if something went wrong in
      inserting the index tuples (primary key failure, for exampl), or processing
      after row triggers.
      
      Fixes bug #8173 reported by Lloyd Albin. Backpatch to 9.2, where the multi-
      insert code was added.
      e2ef2893
  15. 21 May, 2013 1 commit