Skip to content
Snippets Groups Projects
  1. Nov 10, 2015
    • Tom Lane's avatar
      Improve our workaround for 'TeX capacity exceeded' in building PDF files. · e12a99c8
      Tom Lane authored
      In commit a5ec86a7 I wrote a quick hack
      that reduced the number of TeX string pool entries created while converting
      our documentation to PDF form.  That held the fort for awhile, but as of
      HEAD we're back up against the same limitation.  It turns out that the
      original coding of \FlowObjectSetup actually results in *three* string pool
      entries being generated for every "flow object" (that is, potential
      cross-reference target) in the documentation, and my previous hack only got
      rid of one of them.  With a little more care, we can reduce the string
      count to one per flow object plus one per actually-cross-referenced flow
      object (about 115000 + 5000 as of current HEAD); that should work until
      the documentation volume roughly doubles from where it is today.
      
      As a not-incidental side benefit, this change also causes pdfjadetex to
      stop emitting unreferenced hyperlink anchors (bookmarks) into the PDF file.
      It had been making one willy-nilly for every flow object; now it's just one
      per actually-cross-referenced object.  This results in close to a 2X
      savings in PDF file size.  We will still want to run the output through
      "jpdftweak" to get it to be compressed; but we no longer need removal of
      unreferenced bookmarks, so we might be able to find a quicker tool for
      that step.
      
      Although the failure only affects HEAD and US-format output at the moment,
      9.5 cannot be more than a few pages short of failing likewise, so it
      will inevitably fail after a few rounds of minor-version release notes.
      I don't have a lot of faith that we'll never hit the limit in the older
      branches; and anyway it would be nice to get rid of jpdftweak across the
      board.  Therefore, back-patch to all supported branches.
      e12a99c8
  2. Oct 07, 2015
    • Tom Lane's avatar
      Improve documentation of the role-dropping process. · 53951058
      Tom Lane authored
      In general one may have to run both REASSIGN OWNED and DROP OWNED to get
      rid of all the dependencies of a role to be dropped.  This was alluded to
      in the REASSIGN OWNED man page, but not really spelled out in full; and in
      any case the procedure ought to be documented in a more prominent place
      than that.  Add a section to the "Database Roles" chapter explaining this,
      and do a bit of wordsmithing in the relevant commands' man pages.
      53951058
  3. Oct 05, 2015
  4. Oct 02, 2015
    • Tom Lane's avatar
      Docs: add disclaimer about hazards of using regexps from untrusted sources. · 52511fd6
      Tom Lane authored
      It's not terribly hard to devise regular expressions that take large
      amounts of time and/or memory to process.  Recent testing by Greg Stark has
      also shown that machines with small stack limits can be driven to stack
      overflow by suitably crafted regexps.  While we intend to fix these things
      as much as possible, it's probably impossible to eliminate slow-execution
      cases altogether.  In any case we don't want to treat such things as
      security issues.  The history of that code should already discourage
      prudent DBAs from allowing execution of regexp patterns coming from
      possibly-hostile sources, but it seems like a good idea to warn about the
      hazard explicitly.
      
      Currently, similar_escape() allows access to enough of the underlying
      regexp behavior that the warning has to apply to SIMILAR TO as well.
      We might be able to make it safer if we tightened things up to allow only
      SQL-mandated capabilities in SIMILAR TO; but that would be a subtly
      non-backwards-compatible change, so it requires discussion and probably
      could not be back-patched.
      
      Per discussion among pgsql-security list.
      52511fd6
  5. Sep 22, 2015
  6. Sep 16, 2015
    • Tom Lane's avatar
      Fix documentation of regular expression character-entry escapes. · 11103c6d
      Tom Lane authored
      The docs claimed that \uhhhh would be interpreted as a Unicode value
      regardless of the database encoding, but it's never been implemented
      that way: \uhhhh and \xhhhh actually mean exactly the same thing, namely
      the character that pg_mb2wchar translates to 0xhhhh.  Moreover we were
      falsely dismissive of the usefulness of Unicode code points above FFFF.
      Fix that.
      
      It's been like this for ages, so back-patch to all supported branches.
      11103c6d
  7. Sep 07, 2015
  8. Aug 27, 2015
  9. Aug 26, 2015
    • Tom Lane's avatar
      Docs: be explicit about datatype matching for lead/lag functions. · 8cffc4f5
      Tom Lane authored
      The default argument, if given, has to be of exactly the same datatype
      as the first argument; but this was not stated in so many words, and
      the error message you get about it might not lead your thought in the
      right direction.  Per bug #13587 from Robert McGehee.
      
      A quick scan says that these are the only two built-in functions with two
      anyelement arguments and no other polymorphic arguments.  There are plenty
      of cases of, eg, anyarray and anyelement, but those seem less likely to
      confuse.  For instance this doesn't seem terribly hard to figure out:
      "function array_remove(integer[], numeric) does not exist".  So I've
      contented myself with fixing these two cases.
      8cffc4f5
  10. Aug 15, 2015
    • Tom Lane's avatar
      Improve documentation about MVCC-unsafe utility commands. · ed511659
      Tom Lane authored
      The table-rewriting forms of ALTER TABLE are MVCC-unsafe, in much the same
      way as TRUNCATE, because they replace all rows of the table with newly-made
      rows with a new xmin.  (Ideally, concurrent transactions with old snapshots
      would continue to see the old table contents, but the data is not there
      anymore --- and if it were there, it would be inconsistent with the table's
      updated rowtype, so there would be serious implementation problems to fix.)
      This was nowhere documented though, and the problem was only documented for
      TRUNCATE in a note in the TRUNCATE reference page.  Create a new "Caveats"
      section in the MVCC chapter that can be home to this and other limitations
      on serializable consistency.
      
      In passing, fix a mistaken statement that VACUUM and CLUSTER would reclaim
      space occupied by a dropped column.  They don't reconstruct existing tuples
      so they couldn't do that.
      
      Back-patch to all supported branches.
      ed511659
  11. Aug 05, 2015
  12. Jul 29, 2015
    • Tom Lane's avatar
      Update our documentation concerning where to create data directories. · 263f2259
      Tom Lane authored
      Although initdb has long discouraged use of a filesystem mount-point
      directory as a PG data directory, this point was covered nowhere in the
      user-facing documentation.  Also, with the popularity of pg_upgrade,
      we really need to recommend that the PG user own not only the data
      directory but its parent directory too.  (Without a writable parent
      directory, operations such as "mv data data.old" fail immediately.
      pg_upgrade itself doesn't do that, but wrapper scripts for it often do.)
      
      Hence, adjust the "Creating a Database Cluster" section to address
      these points.  I also took the liberty of wordsmithing the discussion
      of NFS a bit.
      
      These considerations aren't by any means new, so back-patch to all
      supported branches.
      263f2259
  13. Jul 28, 2015
    • Andres Freund's avatar
      Disable ssl renegotiation by default. · 2f91e7bb
      Andres Freund authored
      While postgres' use of SSL renegotiation is a good idea in theory, it
      turned out to not work well in practice. The specification and openssl's
      implementation of it have lead to several security issues. Postgres' use
      of renegotiation also had its share of bugs.
      
      Additionally OpenSSL has a bunch of bugs around renegotiation, reported
      and open for years, that regularly lead to connections breaking with
      obscure error messages. We tried increasingly complex workarounds to get
      around these bugs, but we didn't find anything complete.
      
      Since these connection breakages often lead to hard to debug problems,
      e.g. spuriously failing base backups and significant latency spikes when
      synchronous replication is used, we have decided to change the default
      setting for ssl renegotiation to 0 (disabled) in the released
      backbranches and remove it entirely in 9.5 and master..
      
      Author: Michael Paquier, with changes by me
      Discussion: 20150624144148.GQ4797@alap3.anarazel.de
      Backpatch: 9.0-9.4; 9.5 and master get a different patch
      2f91e7bb
  14. Jul 10, 2015
    • Tom Lane's avatar
      Improve documentation about array concat operator vs. underlying functions. · 349ce287
      Tom Lane authored
      The documentation implied that there was seldom any reason to use the
      array_append, array_prepend, and array_cat functions directly.  But that's
      not really true, because they can help make it clear which case is meant,
      which the || operator can't do since it's overloaded to represent all three
      cases.  Add some discussion and examples illustrating the potentially
      confusing behavior that can ensue if the parser misinterprets what was
      meant.
      
      Per a complaint from Michael Herold.  Back-patch to 9.2, which is where ||
      started to behave this way.
      349ce287
  15. Jul 09, 2015
    • Heikki Linnakangas's avatar
      Fix another broken link in documentation. · 8dc8a31a
      Heikki Linnakangas authored
      Tom fixed another one of these in commit 7f32dbcd, but there was another
      almost identical one in libpq docs. Per his comment:
      
      HP's web server has apparently become case-sensitive sometime recently.
      Per bug #13479 from Daniel Abraham.  Corrected link identified by Alvaro.
      8dc8a31a
  16. Jul 06, 2015
    • Fujii Masao's avatar
      Remove incorrect warning from pg_archivecleanup document. · e27d1f3c
      Fujii Masao authored
      The .backup file name can be passed to pg_archivecleanup even if
      it includes the extension which is specified in -x option.
      However, previously the document incorrectly warned a user
      not to do that.
      
      Back-patch to 9.2 where pg_archivecleanup's -x option and
      the warning were added.
      e27d1f3c
  17. Jul 01, 2015
    • Tom Lane's avatar
      Fix broken link in documentation. · 49946f2b
      Tom Lane authored
      HP's web server has apparently become case-sensitive sometime recently.
      Per bug #13479 from Daniel Abraham.  Corrected link identified by Alvaro.
      49946f2b
  18. Jun 25, 2015
  19. Jun 09, 2015
  20. Jun 01, 2015
  21. May 20, 2015
  22. May 18, 2015
    • Tom Lane's avatar
      Last-minute updates for release notes. · f1946b13
      Tom Lane authored
      Add entries for security issues.
      
      Security: CVE-2015-3165 through CVE-2015-3167
      f1946b13
    • Noah Misch's avatar
      pgcrypto: Report errant decryption as "Wrong key or corrupt data". · 0ba20043
      Noah Misch authored
      This has been the predominant outcome.  When the output of decrypting
      with a wrong key coincidentally resembled an OpenPGP packet header,
      pgcrypto could instead report "Corrupt data", "Not text data" or
      "Unsupported compression algorithm".  The distinct "Corrupt data"
      message added no value.  The latter two error messages misled when the
      decrypted payload also exhibited fundamental integrity problems.  Worse,
      error message variance in other systems has enabled cryptologic attacks;
      see RFC 4880 section "14. Security Considerations".  Whether these
      pgcrypto behaviors are likewise exploitable is unknown.
      
      In passing, document that pgcrypto does not resist side-channel attacks.
      Back-patch to 9.0 (all supported versions).
      
      Security: CVE-2015-3167
      0ba20043
  23. May 17, 2015
  24. May 16, 2015
    • Tom Lane's avatar
      Fix docs typo · 639bf57c
      Tom Lane authored
      I don't think "respectfully" is what was meant here ...
      639bf57c
  25. May 14, 2015
  26. May 09, 2015
    • Stephen Frost's avatar
      Recommend include_realm=1 in docs · 21cb21de
      Stephen Frost authored
      As discussed, the default setting of include_realm=0 can be dangerous in
      multi-realm environments because it is then impossible to differentiate
      users with the same username but who are from two different realms.
      
      Recommend include_realm=1 and note that the default setting may change
      in a future version of PostgreSQL and therefore users may wish to
      explicitly set include_realm to avoid issues while upgrading.
      21cb21de
  27. May 05, 2015
  28. Apr 09, 2015
  29. Apr 06, 2015
  30. Apr 02, 2015
    • Alvaro Herrera's avatar
      psql: fix \connect with URIs and conninfo strings · d4bacdcb
      Alvaro Herrera authored
      psql was already accepting conninfo strings as the first parameter in
      \connect, but the way it worked wasn't sane; some of the other
      parameters would get the previous connection's values, causing it to
      connect to a completely unexpected server or, more likely, not finding
      any server at all because of completely wrong combinations of
      parameters.
      
      Fix by explicitely checking for a conninfo-looking parameter in the
      dbname position; if one is found, use its complete specification rather
      than mix with the other arguments.  Also, change tab-completion to not
      try to complete conninfo/URI-looking "dbnames" and document that
      conninfos are accepted as first argument.
      
      There was a weak consensus to backpatch this, because while the behavior
      of using the dbname as a conninfo is nowhere documented for \connect, it
      is reasonable to expect that it works because it does work in many other
      contexts.  Therefore this is backpatched all the way back to 9.0.
      
      To implement this, routines previously private to libpq have been
      duplicated so that psql can decide what looks like a conninfo/URI
      string.  In back branches, just duplicate the same code all the way back
      to 9.2, where URIs where introduced; 9.0 and 9.1 have a simpler version.
      In master, the routines are moved to src/common and renamed.
      
      Author: David Fetter, Andrew Dunstan.  Some editorialization by me
      (probably earning a Gierth's "Sloppy" badge in the process.)
      Reviewers: Andrew Gierth, Erik Rijkers, Pavel Stěhule, Stephen Frost,
      Robert Haas, Andrew Dunstan.
      d4bacdcb
  31. Apr 01, 2015
  32. Mar 08, 2015
    • Tom Lane's avatar
      Fix documentation for libpq's PQfn(). · ae67e81e
      Tom Lane authored
      The SGML docs claimed that 1-byte integers could be sent or received with
      the "isint" options, but no such behavior has ever been implemented in
      pqGetInt() or pqPutInt().  The in-code documentation header for PQfn() was
      even less in tune with reality, and the code itself used parameter names
      matching neither the SGML docs nor its libpq-fe.h declaration.  Do a bit
      of additional wordsmithing on the SGML docs while at it.
      
      Since the business about 1-byte integers is a clear documentation bug,
      back-patch to all supported branches.
      ae67e81e
  33. Mar 02, 2015
    • Stephen Frost's avatar
      Fix pg_dump handling of extension config tables · d13bbfab
      Stephen Frost authored
      Since 9.1, we've provided extensions with a way to denote
      "configuration" tables- tables created by an extension which the user
      may modify.  By marking these as "configuration" tables, the extension
      is asking for the data in these tables to be pg_dump'd (tables which
      are not marked in this way are assumed to be entirely handled during
      CREATE EXTENSION and are not included at all in a pg_dump).
      
      Unfortunately, pg_dump neglected to consider foreign key relationships
      between extension configuration tables and therefore could end up
      trying to reload the data in an order which would cause FK violations.
      
      This patch teaches pg_dump about these dependencies, so that the data
      dumped out is done so in the best order possible.  Note that there's no
      way to handle circular dependencies, but those have yet to be seen in
      the wild.
      
      The release notes for this should include a caution to users that
      existing pg_dump-based backups may be invalid due to this issue.  The
      data is all there, but restoring from it will require extracting the
      data for the configuration tables and then loading them in the correct
      order by hand.
      
      Discussed initially back in bug #6738, more recently brought up by
      Gilles Darold, who provided an initial patch which was further reworked
      by Michael Paquier.  Further modifications and documentation updates
      by me.
      
      Back-patch to 9.1 where we added the concept of extension configuration
      tables.
      d13bbfab
  34. Feb 23, 2015
    • Heikki Linnakangas's avatar
      Fix potential deadlock with libpq non-blocking mode. · 22c9c8a7
      Heikki Linnakangas authored
      If libpq output buffer is full, pqSendSome() function tries to drain any
      incoming data. This avoids deadlock, if the server e.g. sends a lot of
      NOTICE messages, and blocks until we read them. However, pqSendSome() only
      did that in blocking mode. In non-blocking mode, the deadlock could still
      happen.
      
      To fix, take a two-pronged approach:
      
      1. Change the documentation to instruct that when PQflush() returns 1, you
      should wait for both read- and write-ready, and call PQconsumeInput() if it
      becomes read-ready. That fixes the deadlock, but applications are not going
      to change overnight.
      
      2. In pqSendSome(), drain the input buffer before returning 1. This
      alleviates the problem for applications that only wait for write-ready. In
      particular, a slow but steady stream of NOTICE messages during COPY FROM
      STDIN will no longer cause a deadlock. The risk remains that the server
      attempts to send a large burst of data and fills its output buffer, and at
      the same time the client also sends enough data to fill its output buffer.
      The application will deadlock if it goes to sleep, waiting for the socket
      to become write-ready, before the server's data arrives. In practice,
      NOTICE messages and such that the server might be sending are usually
      short, so it's highly unlikely that the server would fill its output buffer
      so quickly.
      
      Backpatch to all supported versions.
      22c9c8a7
  35. Feb 17, 2015
    • Tom Lane's avatar
      Remove code to match IPv4 pg_hba.conf entries to IPv4-in-IPv6 addresses. · d068609b
      Tom Lane authored
      In investigating yesterday's crash report from Hugo Osvaldo Barrera, I only
      looked back as far as commit f3aec2c7 where the breakage occurred
      (which is why I thought the IPv4-in-IPv6 business was undocumented).  But
      actually the logic dates back to commit 3c9bb888 and was simply
      broken by erroneous refactoring in the later commit.  A bit of archives
      excavation shows that we added the whole business in response to a report
      that some 2003-era Linux kernels would report IPv4 connections as having
      IPv4-in-IPv6 addresses.  The fact that we've had no complaints since 9.0
      seems to be sufficient confirmation that no modern kernels do that, so
      let's just rip it all out rather than trying to fix it.
      
      Do this in the back branches too, thus essentially deciding that our
      effective behavior since 9.0 is correct.  If there are any platforms on
      which the kernel reports IPv4-in-IPv6 addresses as such, yesterday's fix
      would have made for a subtle and potentially security-sensitive change in
      the effective meaning of IPv4 pg_hba.conf entries, which does not seem like
      a good thing to do in minor releases.  So let's let the post-9.0 behavior
      stand, and change the documentation to match it.
      
      In passing, I failed to resist the temptation to wordsmith the description
      of pg_hba.conf IPv4 and IPv6 address entries a bit.  A lot of this text
      hasn't been touched since we were IPv4-only.
      d068609b
  36. Feb 11, 2015
    • Michael Meskes's avatar
      Fixed array handling in ecpg. · 9be9ac42
      Michael Meskes authored
      When ecpg was rewritten to the new protocol version not all variable types
      were corrected. This patch rewrites the code for these types to fix that. It
      also fixes the documentation to correctly tell the status of array handling.
      9be9ac42
Loading