1. 03 Mar, 2017 8 commits
    • Peter Eisentraut's avatar
      psql: Add tab completion for logical replication · 6f236e1e
      Peter Eisentraut authored
      Add tab completion for publications and subscriptions.  Also, to be able
      to get a list of subscriptions, make pg_subscription world-readable but
      revoke access to subconninfo using column privileges.
      
      From: Michael Paquier <michael.paquier@gmail.com>
      6f236e1e
    • Peter Eisentraut's avatar
      Add RENAME support for PUBLICATIONs and SUBSCRIPTIONs · 6da9759a
      Peter Eisentraut authored
      From: Petr Jelinek <petr.jelinek@2ndquadrant.com>
      6da9759a
    • Peter Eisentraut's avatar
      Fix after trigger execution in logical replication · 713f7c47
      Peter Eisentraut authored
      From: Petr Jelinek <petr.jelinek@2ndquadrant.com>
      Tested-by: default avatarThom Brown <thom@linux.com>
      713f7c47
    • Peter Eisentraut's avatar
      Use asynchronous connect API in libpqwalreceiver · 1e8a8500
      Peter Eisentraut authored
      This makes the connection attempt from CREATE SUBSCRIPTION and from
      WalReceiver interruptable by the user in case the libpq connection is
      hanging.  The previous coding required immediate shutdown (SIGQUIT) of
      PostgreSQL in that situation.
      
      From: Petr Jelinek <petr.jelinek@2ndquadrant.com>
      Tested-by: default avatarThom Brown <thom@linux.com>
      1e8a8500
    • Simon Riggs's avatar
      Allow vacuums to report oldestxmin · 9eb344fa
      Simon Riggs authored
      Allow VACUUM and Autovacuum to report the oldestxmin value they
      used while cleaning tables, helping to make better sense out of
      the other statistics we report in various cases.
      9eb344fa
    • Robert Haas's avatar
      Add pg_current_logfile() function. · 19dc233c
      Robert Haas authored
      The syslogger will write out the current stderr and csvlog names, if
      it's running and there are any, to a new file in the data directory
      called "current_logfiles".  We take care to remove this file when it
      might no longer be valid (but not at shutdown).  The function
      pg_current_logfile() can be used to read the entries in the file.
      
      Gilles Darold, reviewed and modified by Karl O.  Pinc, Michael
      Paquier, and me.  Further review by Álvaro Herrera and Christoph Berg.
      19dc233c
    • Robert Haas's avatar
      Notify bgworker registrant after freeing worker slot. · aea5d298
      Robert Haas authored
      Tom Lane observed buildfarm failures caused by the select_parallel
      regression test trying to launch new parallel queries before the
      worker slots used by the previous ones were freed.  Try to fix this by
      having the postmaster free the worker slots before it sends the
      SIGUSR1 notifications to the registering process.  This doesn't
      completely eliminate the possibility that the user backend might
      (correctly) observe the worker as dead before the slot is free, but I
      believe it should make the window significantly narrower.
      
      Patch by me, per complaint from Tom Lane.  Reviewed by Amit Kapila.
      
      Discussion: http://postgr.es/m/30673.1487310734@sss.pgh.pa.us
      aea5d298
    • Robert Haas's avatar
      Improve error reporting for tuple-routing failures. · 5a73e173
      Robert Haas authored
      Currently, the whole row is shown without column names.  Instead,
      adopt a style similar to _bt_check_unique() in ExecFindPartition()
      and show the failing key: (key1, ...) = (val1, ...).
      
      Amit Langote, per a complaint from Simon Riggs.  Reviewed by me;
      I also adjusted the grammar in one of the comments.
      
      Discussion: http://postgr.es/m/9f9dc7ae-14f0-4a25-5485-964d9bfc19bd@lab.ntt.co.jp
      5a73e173
  2. 02 Mar, 2017 6 commits
  3. 01 Mar, 2017 11 commits
  4. 28 Feb, 2017 2 commits
  5. 27 Feb, 2017 8 commits
    • Tom Lane's avatar
      Allow index AMs to return either HeapTuple or IndexTuple format during IOS. · 9b88f27c
      Tom Lane authored
      Previously, only IndexTuple format was supported for the output data of
      an index-only scan.  This is fine for btree, which is just returning a
      verbatim index tuple anyway.  It's not so fine for SP-GiST, which can
      return reconstructed data that's much larger than a page.
      
      To fix, extend the index AM API so that index-only scan data can be
      returned in either HeapTuple or IndexTuple format.  There's other ways
      we could have done it, but this way avoids an API break for index AMs
      that aren't concerned with the issue, and it costs little except a couple
      more fields in IndexScanDescs.
      
      I changed both GiST and SP-GiST to use the HeapTuple method.  I'm not
      very clear on whether GiST can reconstruct data that's too large for an
      IndexTuple, but that seems possible, and it's not much of a code change to
      fix.
      
      Per a complaint from Vik Fearing.  Reviewed by Jason Li.
      
      Discussion: https://postgr.es/m/49527f79-530d-0bfe-3dad-d183596afa92@2ndquadrant.fr
      9b88f27c
    • Robert Haas's avatar
      hash: Refactor overflow page allocation. · 30df93f6
      Robert Haas authored
      As with commit b0f18cb7, the goal
      here is to move all of the related page modifications to a single
      section of code, in preparation for adding write-ahead logging.
      
      Amit Kapila, with slight changes by me.  The larger patch series
      of which this is a part has been reviewed and tested by Álvaro
      Herrera, Ashutosh Sharma, Mark Kirkwood, Jeff Janes, and Jesper
      Pedersen, all of whom should also have been credited in the
      previous commit message.
      30df93f6
    • Robert Haas's avatar
      hash: Refactor bucket squeeze code. · b0f18cb7
      Robert Haas authored
      In preparation for adding write-ahead logging to hash indexes,
      refactor _hash_freeovflpage and _hash_squeezebucket so that all
      related page modifications happen in a single section of code.  The
      previous coding assumed that it would be fine to move tuples one at a
      time, and also that the various operations involved in freeing an
      overflow page didn't necessarily all need to be done together, all
      of which is true if you don't care about write-ahead logging.
      
      Amit Kapila, with slight changes by me.
      b0f18cb7
    • Tom Lane's avatar
      Remove PL/Tcl's "module" facility. · 817f2a58
      Tom Lane authored
      PL/Tcl has long had a facility whereby Tcl code could be autoloaded from
      a database table named "pltcl_modules".  However, nobody is using it, as
      evidenced by the recent discovery that it's never been fixed to work with
      standard_conforming_strings turned on.  Moreover, it's rather shaky from
      a security standpoint, and the table design is very old and crufty (partly
      because it dates from before we had TOAST).  A final problem is that
      because the table-population scripts depend on the Tcl client library
      Pgtcl, which we removed from the core distribution in 2004, it's
      impossible to create a self-contained regression test for the feature.
      Rather than try to surmount these problems, let's just remove it.
      
      A follow-on patch will provide a way to execute user-defined
      initialization code, similar to features that exist in plperl and plv8.
      With that, it will be possible to implement this feature or similar ones
      entirely in userspace, which is where it belongs.
      
      Discussion: https://postgr.es/m/22067.1488046447@sss.pgh.pa.us
      817f2a58
    • Peter Eisentraut's avatar
      chomp PQerrorMessage() in backend uses · 2ed193c9
      Peter Eisentraut authored
      PQerrorMessage() returns an error message with a trailing newline, but
      in backend use (dblink, postgres_fdw, libpqwalreceiver), we want to have
      the error message without that for emitting via ereport().  To simplify
      that, add a function pchomp() that returns a pstrdup'ed string with the
      trailing newline characters removed.
      2ed193c9
    • Andres Freund's avatar
      Use the new "Slab" context for some allocations in reorderbuffer.h. · 9fab40ad
      Andres Freund authored
      Note that this change alone does not yet fully address the performance
      problems triggering this work, a large portion of the slowdown is
      triggered by the tuple allocator, which isn't converted to the new
      allocator.  It would be possible to do so, but using evenly sized
      objects, like both the current implementation in reorderbuffer.c and
      slab.c, wastes a fair amount of memory.  A later patch by Tomas will
      introduce a better approach.
      
      Author: Tomas Vondra
      Reviewed-By: Andres Freund
      Discussion: https://postgr.es/m/d15dff83-0b37-28ed-0809-95a5cc7292ad@2ndquadrant.com
      9fab40ad
    • Andres Freund's avatar
      Add "Slab" MemoryContext implementation for efficient equal-sized allocations. · 58b25e98
      Andres Freund authored
      The default general purpose aset.c style memory context is not a great
      choice for allocations that are all going to be evenly sized,
      especially when those objects aren't small, and have varying
      lifetimes.  There tends to be a lot of fragmentation, larger
      allocations always directly go to libc rather than have their cost
      amortized over several pallocs.
      
      These problems lead to the introduction of ad-hoc slab allocators in
      reorderbuffer.c. But it turns out that the simplistic implementation
      leads to problems when a lot of objects are allocated and freed, as
      aset.c is still the underlying implementation. Especially freeing can
      easily run into O(n^2) behavior in aset.c.
      
      While the O(n^2) behavior in aset.c can, and probably will, be
      addressed, custom allocators for this behavior are more efficient
      both in space and time.
      
      This allocator is for evenly sized allocations, and supports both
      cheap allocations and freeing, without fragmenting significantly.  It
      does so by allocating evenly sized blocks via malloc(), and carves
      them into chunks that can be used for allocations.  In order to
      release blocks to the OS as early as possible, chunks are allocated
      from the fullest block that still has free objects, increasing the
      likelihood of a block being entirely unused.
      
      A subsequent commit uses this in reorderbuffer.c, but a further
      allocator is needed to resolve the performance problems triggering
      this work.
      
      There likely are further potentialy uses of this allocator besides
      reorderbuffer.c.
      
      There's potential further optimizations of the new slab.c, in
      particular the array of freelists could be replaced by a more
      intelligent structure - but for now this looks more than good enough.
      
      Author: Tomas Vondra, editorialized by Andres Freund
      Reviewed-By: Andres Freund, Petr Jelinek, Robert Haas, Jim Nasby
      Discussion: https://postgr.es/m/d15dff83-0b37-28ed-0809-95a5cc7292ad@2ndquadrant.com
      58b25e98
    • Andres Freund's avatar
      Make useful infrastructure from aset.c generally available. · bfd12ccc
      Andres Freund authored
      An upcoming patch introduces a new type of memory context. To avoid
      duplicating debugging infrastructure within aset.c, move useful pieces
      to memdebug.[ch].
      
      While touching aset.c, fix printf format code in AllocFree* debug
      macros.
      
      Author: Tomas Vondra
      Reviewed-By: Andres Freund
      Discussion: https://postgr.es/m/b3b2245c-b37a-e1e5-ebc4-857c914bc747@2ndquadrant.com
      bfd12ccc
  6. 26 Feb, 2017 5 commits