Skip to content
Snippets Groups Projects
  1. Sep 08, 2014
    • Tom Lane's avatar
      Fix psql \s to work with recent libedit, and add pager support. · 886b58b4
      Tom Lane authored
      psql's \s (print command history) doesn't work at all with recent libedit
      versions when printing to the terminal, because libedit tries to do an
      fchmod() on the target file which will fail if the target is /dev/tty.
      (We'd already noted this in the context of the target being /dev/null.)
      Even before that, it didn't work pleasantly, because libedit likes to
      encode the command history file (to ensure successful reloading), which
      renders it nigh unreadable, not to mention significantly different-looking
      depending on exactly which libedit version you have.  So let's forget using
      write_history() for this purpose, and instead print the data ourselves,
      using logic similar to that used to iterate over the history for newline
      encoding/decoding purposes.
      
      While we're at it, insert the ability to use the pager when \s is printing
      to the terminal.  This has been an acknowledged shortcoming of \s for many
      years, so while you could argue it's not exactly a back-patchable bug fix
      it still seems like a good improvement.  Anyone who's seriously annoyed
      at this can use "\s /dev/tty" or local equivalent to get the old behavior.
      
      Experimentation with this showed that the history iteration logic was
      actually rather broken when used with libedit.  It turns out that with
      libedit you have to use previous_history() not next_history() to advance
      to more recent history entries.  The easiest and most robust fix for this
      seems to be to make a run-time test to verify which function to call.
      We had not noticed this because libedit doesn't really need the newline
      encoding logic: its own encoding ensures that command entries containing
      newlines are reloaded correctly (unlike libreadline).  So the effective
      behavior with recent libedits was that only the oldest history entry got
      newline-encoded or newline-decoded.  However, because of yet other bugs in
      history_set_pos(), some old versions of libedit allowed the existing loop
      logic to reach entries besides the oldest, which means there may be libedit
      ~/.psql_history files out there containing encoded newlines in more than
      just the oldest entry.  To ensure we can reload such files, it seems
      appropriate to back-patch this fix, even though that will result in some
      incompatibility with older psql versions (ie, multiline history entries
      written by a psql with this fix will look corrupted to a psql without it,
      if its libedit is reasonably up to date).
      
      Stepan Rutz and Tom Lane
      886b58b4
    • Tom Lane's avatar
      Documentation fix: sum(float4) returns float4, not float8. · 4cadb8a5
      Tom Lane authored
      The old claim is from my commit d06ebdb8 of
      2000-07-17, but it seems to have been a plain old thinko; sum(float4) has
      been distinct from sum(float8) since Berkeley days.  Noted by KaiGai Kohei.
      
      While at it, mention the existence of sum(money), which is also of
      embarrassingly ancient vintage.
      4cadb8a5
  2. Aug 30, 2014
  3. Aug 18, 2014
  4. Aug 14, 2014
    • Tom Lane's avatar
      Update SysV parameter configuration documentation for FreeBSD. · c5e2333a
      Tom Lane authored
      FreeBSD hasn't made any use of kern.ipc.semmap since 1.1, and newer
      releases reject attempts to set it altogether; so stop recommending
      that it be adjusted.  Per bug #11161.
      
      Back-patch to all supported branches.  Before 9.3, also incorporate
      commit 7a42dff4, which touches the same text and for some reason
      was not back-patched at the time.
      c5e2333a
  5. Aug 11, 2014
    • Fujii Masao's avatar
      Fix failure to follow the directions when "init" fork was added. · 054fc309
      Fujii Masao authored
      Specifically this commit updates forkname_to_number() so that the HINT
      message includes "init" fork, and also adds the description of "init" fork
      into pg_relation_size() document.
      
      This is a part of the commit 2d001904
      which has fixed the same oversight in master and 9.4. Back-patch to
      9.1 where "init" fork was added.
      054fc309
    • Fujii Masao's avatar
      Fix documentation oversights about pageinspect and initialization fork. · 84317b07
      Fujii Masao authored
      The initialization fork was added in 9.1, but has not been taken into
      consideration in documents of get_raw_page function in pageinspect and
      storage layout. This commit fixes those oversights.
      
      get_raw_page can read not only a table but also an index, etc. So it
      should be documented that the function can read any relation. This commit
      also fixes the document of pageinspect that way.
      
      Back-patch to 9.1 where those oversights existed.
      
      Vik Fearing, review by MauMau
      84317b07
  6. Aug 10, 2014
    • Tom Lane's avatar
      Clarify type resolution behavior for domain types. · 6079e5d4
      Tom Lane authored
      The user documentation was vague and not entirely accurate about how
      we treat domain inputs for ambiguous operators/functions.  Clarify
      that, and add an example and some commentary.  Per a recent question
      from Adam Mackler.
      
      It's acted like this ever since we added domains, so back-patch
      to all supported branches.
      6079e5d4
  7. Aug 01, 2014
  8. Jul 28, 2014
    • Fujii Masao's avatar
      Fix typo in doc. · af9d5162
      Fujii Masao authored
      unix_socket_directories was introduced in 9.3, but the document
      in older versions wrongly have mentioned it. This commit replaces
      it with the correct older name unix_socket_directory.
      
      This is applied to only 9.2 and older supported versions.
      
      Guillaume Lelarge
      af9d5162
  9. Jul 23, 2014
    • Tom Lane's avatar
      Rearrange documentation paragraph describing pg_relation_size(). · 1da2f64f
      Tom Lane authored
      Break the list of available options into an <itemizedlist> instead of
      inline sentences.  This is mostly motivated by wanting to ensure that the
      cross-references to the FSM and VM docs don't cross page boundaries in PDF
      format; but it seems to me to read more easily this way anyway.  I took the
      liberty of editorializing a bit further while at it.
      
      Per complaint from Magnus about 9.0.18 docs not building in A4 format.
      Patch all active branches so we don't get blind-sided by this particular
      issue again in future.
      1da2f64f
  10. Jul 21, 2014
  11. Jul 20, 2014
  12. Jul 18, 2014
  13. Jul 15, 2014
  14. Jun 26, 2014
    • Fujii Masao's avatar
      Remove obsolete example of CSV log file name from log_filename document. · 4ee45945
      Fujii Masao authored
      7380b638 changed log_filename so that epoch was not appended to it
      when no format specifier is given. But the example of CSV log file name
      with epoch still left in log_filename document. This commit removes
      such obsolete example.
      
      This commit also documents the defaults of log_directory and
      log_filename.
      
      Backpatch to all supported versions.
      
      Christoph Berg
      4ee45945
  15. Jun 21, 2014
    • Kevin Grittner's avatar
      Fix documentation template for CREATE TRIGGER. · 07353de4
      Kevin Grittner authored
      By using curly braces, the template had specified that one of
      "NOT DEFERRABLE", "INITIALLY IMMEDIATE", or "INITIALLY DEFERRED"
      was required on any CREATE TRIGGER statement, which is not
      accurate.  Change to square brackets makes that optional.
      
      Backpatch to 9.1, where the error was introduced.
      07353de4
  16. Jun 14, 2014
    • Noah Misch's avatar
      Secure Unix-domain sockets of "make check" temporary clusters. · 453a5d91
      Noah Misch authored
      Any OS user able to access the socket can connect as the bootstrap
      superuser and proceed to execute arbitrary code as the OS user running
      the test.  Protect against that by placing the socket in a temporary,
      mode-0700 subdirectory of /tmp.  The pg_regress-based test suites and
      the pg_upgrade test suite were vulnerable; the $(prove_check)-based test
      suites were already secure.  Back-patch to 8.4 (all supported versions).
      The hazard remains wherever the temporary cluster accepts TCP
      connections, notably on Windows.
      
      As a convenient side effect, this lets testing proceed smoothly in
      builds that override DEFAULT_PGSOCKET_DIR.  Popular non-default values
      like /var/run/postgresql are often unwritable to the build user.
      
      Security: CVE-2014-0067
      453a5d91
  17. May 09, 2014
  18. Apr 03, 2014
    • Tom Lane's avatar
      Fix documentation about joining pg_locks to other views. · 6c1cfbac
      Tom Lane authored
      The advice to join to pg_prepared_xacts via the transaction column was not
      updated when the transaction column was replaced by virtualtransaction.
      Since it's not quite obvious how to do that join, give an explicit example.
      For consistency also give an example for the adjacent case of joining to
      pg_stat_activity.  And link-ify the view references too, just because we
      can.  Per bug #9840 from Alexey Bashtanov.
      
      Michael Paquier and Tom Lane
      6c1cfbac
    • Tom Lane's avatar
      Fix documentation about size of interval type. · 4f304875
      Tom Lane authored
      It's been 16 bytes, not 12, for ages.  This was fixed in passing in HEAD
      (commit 146604ec), but as a factual error it should have been back-patched.
      Per gripe from Tatsuhito Kasahara.
      4f304875
  19. Mar 29, 2014
    • Noah Misch's avatar
      Revert "Secure Unix-domain sockets of "make check" temporary clusters." · 8c1797e5
      Noah Misch authored
      About half of the buildfarm members use too-long directory names,
      strongly suggesting that this approach is a dead end.
      8c1797e5
    • Noah Misch's avatar
      Secure Unix-domain sockets of "make check" temporary clusters. · 83d12a99
      Noah Misch authored
      Any OS user able to access the socket can connect as the bootstrap
      superuser and in turn execute arbitrary code as the OS user running the
      test.  Protect against that by placing the socket in the temporary data
      directory, which has mode 0700 thanks to initdb.  Back-patch to 8.4 (all
      supported versions).  The hazard remains wherever the temporary cluster
      accepts TCP connections, notably on Windows.
      
      Attempts to run "make check" from a directory with a long name will now
      fail.  An alternative not sharing that problem was to place the socket
      in a subdirectory of /tmp, but that is only secure if /tmp is sticky.
      The PG_REGRESS_SOCK_DIR environment variable is available as a
      workaround when testing from long directory paths.
      
      As a convenient side effect, this lets testing proceed smoothly in
      builds that override DEFAULT_PGSOCKET_DIR.  Popular non-default values
      like /var/run/postgresql are often unwritable to the build user.
      
      Security: CVE-2014-0067
      83d12a99
    • Noah Misch's avatar
      Document platform-specificity of unix_socket_permissions. · c1932ec9
      Noah Misch authored
      Back-patch to 8.4 (all supported versions).
      c1932ec9
  20. Mar 27, 2014
  21. Mar 25, 2014
  22. Mar 17, 2014
  23. Mar 07, 2014
  24. Feb 17, 2014
    • Tom Lane's avatar
      Last-minute updates for release notes. · 4bde115e
      Tom Lane authored
      Add entries for security issues.
      
      Security: CVE-2014-0060 through CVE-2014-0067
      4bde115e
    • Tom Lane's avatar
      Document risks of "make check" in the regression testing instructions. · ff3d533e
      Tom Lane authored
      Since the temporary server started by "make check" uses "trust"
      authentication, another user on the same machine could connect to it
      as database superuser, and then potentially exploit the privileges of
      the operating-system user who started the tests.  We should change
      the testing procedures to prevent this risk; but discussion is required
      about the best way to do that, as well as more testing than is practical
      for an undisclosed security problem.  Besides, the same issue probably
      affects some user-written test harnesses.  So for the moment, we'll just
      warn people against using "make check" when there are untrusted users on
      the same machine.
      
      In passing, remove some ancient advice that suggested making the
      regression testing subtree world-writable if you'd built as root.
      That looks dangerously insecure in modern contexts, and anyway we
      should not be encouraging people to build Postgres as root.
      
      Security: CVE-2014-0067
      ff3d533e
    • Noah Misch's avatar
      Document security implications of check_function_bodies. · c38c3080
      Noah Misch authored
      Back-patch to 8.4 (all supported versions).
      c38c3080
    • Noah Misch's avatar
      Prevent privilege escalation in explicit calls to PL validators. · 1d701d28
      Noah Misch authored
      The primary role of PL validators is to be called implicitly during
      CREATE FUNCTION, but they are also normal functions that a user can call
      explicitly.  Add a permissions check to each validator to ensure that a
      user cannot use explicit validator calls to achieve things he could not
      otherwise achieve.  Back-patch to 8.4 (all supported versions).
      Non-core procedural language extensions ought to make the same two-line
      change to their own validators.
      
      Andres Freund, reviewed by Tom Lane and Noah Misch.
      
      Security: CVE-2014-0061
      1d701d28
    • Noah Misch's avatar
      Shore up ADMIN OPTION restrictions. · 15a8f97b
      Noah Misch authored
      Granting a role without ADMIN OPTION is supposed to prevent the grantee
      from adding or removing members from the granted role.  Issuing SET ROLE
      before the GRANT bypassed that, because the role itself had an implicit
      right to add or remove members.  Plug that hole by recognizing that
      implicit right only when the session user matches the current role.
      Additionally, do not recognize it during a security-restricted operation
      or during execution of a SECURITY DEFINER function.  The restriction on
      SECURITY DEFINER is not security-critical.  However, it seems best for a
      user testing his own SECURITY DEFINER function to see the same behavior
      others will see.  Back-patch to 8.4 (all supported versions).
      
      The SQL standards do not conflate roles and users as PostgreSQL does;
      only SQL roles have members, and only SQL users initiate sessions.  An
      application using PostgreSQL users and roles as SQL users and roles will
      never attempt to grant membership in the role that is the session user,
      so the implicit right to add or remove members will never arise.
      
      The security impact was mostly that a role member could revoke access
      from others, contrary to the wishes of his own grantor.  Unapproved role
      member additions are less notable, because the member can still largely
      achieve that by creating a view or a SECURITY DEFINER function.
      
      Reviewed by Andres Freund and Tom Lane.  Reported, independently, by
      Jonas Sundman and Noah Misch.
      
      Security: CVE-2014-0060
      15a8f97b
    • Tom Lane's avatar
      9649892c
  25. Feb 14, 2014
    • Tom Lane's avatar
      Update regression testing instructions. · 21bfc74c
      Tom Lane authored
      This documentation never got the word about the existence of check-world or
      installcheck-world.  Revise to recommend use of those, and document all the
      subsidiary test suites.  Do some minor wordsmithing elsewhere, too.
      
      In passing, remove markup related to generation of plain-text regression
      test instructions, since we don't do that anymore.
      
      Back-patch to 9.1 where check-world was added.  (installcheck-world exists
      in 9.0; but since check-world doesn't, this patch would need additional
      work to cover that branch, and it doesn't seem worth the effort.)
      21bfc74c
    • Tom Lane's avatar
      Suggest shell here-documents instead of psql -c for multiple commands. · c40b2d59
      Tom Lane authored
      The documentation suggested using "echo | psql", but not the often-superior
      alternative of a here-document.  Also, be more direct about suggesting
      that people avoid -c for multiple commands.  Per discussion.
      c40b2d59
  26. Feb 13, 2014
    • Tom Lane's avatar
      Improve cross-references between minor version release notes. · 22fce59a
      Tom Lane authored
      We have a practice of providing a "bread crumb" trail between the minor
      versions where the migration section actually tells you to do something.
      Historically that was just plain text, eg, "see the release notes for
      9.2.4"; but if you're using a browser or PDF reader, it's a lot nicer
      if it's a live hyperlink.  So use "<xref>" instead.  Any argument against
      doing this vanished with the recent decommissioning of plain-text release
      notes.
      
      Vik Fearing
      22fce59a
Loading