Skip to content
Snippets Groups Projects
  1. Aug 01, 2016
    • Tom Lane's avatar
      Doc: remove claim that hash index creation depends on effective_cache_size. · de818d4c
      Tom Lane authored
      This text was added by commit ff213239, and not long thereafter obsoleted
      by commit 4adc2f72 (which made the test depend on NBuffers instead); but
      nobody noticed the need for an update.  Commit 9563d5b5 adds some further
      dependency on maintenance_work_mem, but the existing verbiage seems to
      cover that with about as much precision as we really want here.  Let's
      just take it all out rather than leaving ourselves open to more errors of
      omission in future.  (That solution makes this change back-patchable, too.)
      
      Noted by Peter Geoghegan.
      
      Discussion: <CAM3SWZRVANbj9GA9j40fAwheQCZQtSwqTN1GBTVwRrRbmSf7cg@mail.gmail.com>
      de818d4c
  2. Jul 28, 2016
    • Tom Lane's avatar
      Improve documentation about CREATE TABLE ... LIKE. · a9a99818
      Tom Lane authored
      The docs failed to explain that LIKE INCLUDING INDEXES would not preserve
      the names of indexes and associated constraints.  Also, it wasn't mentioned
      that EXCLUDE constraints would be copied by this option.  The latter
      oversight seems enough of a documentation bug to justify back-patching.
      
      In passing, do some minor copy-editing in the same area, and add an entry
      for LIKE under "Compatibility", since it's not exactly a faithful
      implementation of the standard's feature.
      
      Discussion: <20160728151154.AABE64016B@smtp.hushmail.com>
      a9a99818
  3. Jun 19, 2016
    • Tom Lane's avatar
      Docs: improve description of psql's %R prompt escape sequence. · 09e592b3
      Tom Lane authored
      Dilian Palauzov pointed out in bug #14201 that the docs failed to mention
      the possibility of %R producing '(' due to an unmatched parenthesis.
      
      He proposed just adding that in the same style as the other options were
      listed; but it seemed to me that the sentence was already nearly
      unintelligible, so I rewrote it a bit more extensively.
      
      Report: <20160619121113.5789.68274@wrigleys.postgresql.org>
      09e592b3
  4. May 20, 2016
  5. Apr 06, 2016
  6. Mar 30, 2016
  7. Feb 16, 2016
    • Tom Lane's avatar
      Improve documentation about CREATE INDEX CONCURRENTLY. · 528db6ab
      Tom Lane authored
      Clarify the description of which transactions will block a CREATE INDEX
      CONCURRENTLY command from proceeding, and mention that the index might
      still not be usable after CREATE INDEX completes.  (This happens if the
      index build detected broken HOT chains, so that pg_index.indcheckxmin gets
      set, and there are open old transactions preventing the xmin horizon from
      advancing past the index's initial creation.  I didn't want to explain what
      broken HOT chains are, though, so I omitted an explanation of exactly when
      old transactions prevent the index from being used.)
      
      Per discussion with Chris Travers.  Back-patch to all supported branches,
      since the same text appears in all of them.
      528db6ab
  8. Feb 11, 2016
    • Noah Misch's avatar
      Accept pg_ctl timeout from the PGCTLTIMEOUT environment variable. · 4421b525
      Noah Misch authored
      Many automated test suites call pg_ctl.  Buildfarm members axolotl,
      hornet, mandrill, shearwater, sungazer and tern have failed when server
      shutdown took longer than the pg_ctl default 60s timeout.  This addition
      permits slow hosts to easily raise the timeout without us editing a
      --timeout argument into every test suite pg_ctl call.  Back-patch to 9.1
      (all supported versions) for the sake of automated testing.
      
      Reviewed by Tom Lane.
      4421b525
  9. Feb 07, 2016
    • Tom Lane's avatar
      Improve documentation about PRIMARY KEY constraints. · ddcc256c
      Tom Lane authored
      Get rid of the false implication that PRIMARY KEY is exactly equivalent to
      UNIQUE + NOT NULL.  That was more-or-less true at one time in our
      implementation, but the standard doesn't say that, and we've grown various
      features (many of them required by spec) that treat a pkey differently from
      less-formal constraints.  Per recent discussion on pgsql-general.
      
      I failed to resist the temptation to do some other wordsmithing in the
      same area.
      ddcc256c
  10. Dec 14, 2015
    • Tom Lane's avatar
      Docs: document that psql's "\i -" means read from stdin. · 6436445e
      Tom Lane authored
      This has worked that way for a long time, maybe always, but you would
      not have known it from the documentation.  Also back-patch the notes
      I added to HEAD earlier today about behavior of the "-f -" switch,
      which likewise have been valid for many releases.
      6436445e
  11. Nov 22, 2015
    • Tom Lane's avatar
      Adopt the GNU convention for handling tar-archive members exceeding 8GB. · b054ca03
      Tom Lane authored
      The POSIX standard for tar headers requires archive member sizes to be
      printed in octal with at most 11 digits, limiting the representable file
      size to 8GB.  However, GNU tar and apparently most other modern tars
      support a convention in which oversized values can be stored in base-256,
      allowing any practical file to be a tar member.  Adopt this convention
      to remove two limitations:
      * pg_dump with -Ft output format failed if the contents of any one table
      exceeded 8GB.
      * pg_basebackup failed if the data directory contained any file exceeding
      8GB.  (This would be a fatal problem for installations configured with a
      table segment size of 8GB or more, and it has also been seen to fail when
      large core dump files exist in the data directory.)
      
      File sizes under 8GB are still printed in octal, so that no compatibility
      issues are created except in cases that would have failed entirely before.
      
      In addition, this patch fixes several bugs in the same area:
      
      * In 9.3 and later, we'd defined tarCreateHeader's file-size argument as
      size_t, which meant that on 32-bit machines it would write a corrupt tar
      header for file sizes between 4GB and 8GB, even though no error was raised.
      This broke both "pg_dump -Ft" and pg_basebackup for such cases.
      
      * pg_restore from a tar archive would fail on tables of size between 4GB
      and 8GB, on machines where either "size_t" or "unsigned long" is 32 bits.
      This happened even with an archive file not affected by the previous bug.
      
      * pg_basebackup would fail if there were files of size between 4GB and 8GB,
      even on 64-bit machines.
      
      * In 9.3 and later, "pg_basebackup -Ft" failed entirely, for any file size,
      on 64-bit big-endian machines.
      
      In view of these potential data-loss bugs, back-patch to all supported
      branches, even though removal of the documented 8GB limit might otherwise
      be considered a new feature rather than a bug fix.
      b054ca03
  12. 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
  13. Oct 05, 2015
    • Andres Freund's avatar
      Remove outdated comment about relation level autovacuum freeze limits. · 6cb5bdec
      Andres Freund authored
      The documentation for the autovacuum_multixact_freeze_max_age and
      autovacuum_freeze_max_age relation level parameters contained:
      "Note that while you can set autovacuum_multixact_freeze_max_age very
      small, or even zero, this is usually unwise since it will force frequent
      vacuuming."
      which hasn't been true since these options were made relation options,
      instead of residing in the pg_autovacuum table (834a6da4).
      
      Remove the outdated sentence. Even the lowered limits from 2596d705 are
      high enough that this doesn't warrant calling out the risk in the CREATE
      TABLE docs.
      
      Per discussion with Tom Lane and Alvaro Herrera
      
      Discussion: 26377.1443105453@sss.pgh.pa.us
      Backpatch: 9.0- (in parts)
      6cb5bdec
  14. 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
  15. 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
  16. Apr 01, 2015
  17. Feb 02, 2015
  18. Feb 01, 2015
    • Tom Lane's avatar
      Fix documentation of psql's ECHO all mode. · ad48256b
      Tom Lane authored
      "ECHO all" is ignored for interactive input, and has been for a very long
      time, though possibly not for as long as the documentation has claimed the
      opposite.  Fix that, and also note that empty lines aren't echoed, which
      while dubious is another longstanding behavior (it's embedded in our
      regression test files for one thing).  Per bug #12721 from Hans Ginzel.
      
      In HEAD, also improve the code comments in this area, and suppress an
      unnecessary fflush(stdout) when we're not echoing.  That would likely
      be safe to back-patch, but I'll not risk it mere hours before a release
      wrap.
      ad48256b
  19. Dec 31, 2014
    • Tom Lane's avatar
      Improve consistency of parsing of psql's magic variables. · 64c50653
      Tom Lane authored
      For simple boolean variables such as ON_ERROR_STOP, psql has for a long
      time recognized variant spellings of "on" and "off" (such as "1"/"0"),
      and it also made a point of warning you if you'd misspelled the setting.
      But these conveniences did not exist for other keyword-valued variables.
      In particular, though ECHO_HIDDEN and ON_ERROR_ROLLBACK include "on" and
      "off" as possible values, none of the alternative spellings for those were
      recognized; and to make matters worse the code would just silently assume
      "on" was meant for any unrecognized spelling.  Several people have reported
      getting bitten by this, so let's fix it.  In detail, this patch:
      
      * Allows all spellings recognized by ParseVariableBool() for ECHO_HIDDEN
      and ON_ERROR_ROLLBACK.
      
      * Reports a warning for unrecognized values for COMP_KEYWORD_CASE, ECHO,
      ECHO_HIDDEN, HISTCONTROL, ON_ERROR_ROLLBACK, and VERBOSITY.
      
      * Recognizes all values for all these variables case-insensitively;
      previously there was a mishmash of case-sensitive and case-insensitive
      behaviors.
      
      Back-patch to all supported branches.  There is a small risk of breaking
      existing scripts that were accidentally failing to malfunction; but the
      consensus is that the chance of detecting real problems and preventing
      future mistakes outweighs this.
      64c50653
  20. Dec 29, 2014
    • Tom Lane's avatar
      Assorted minor fixes for psql metacommand docs. · c61e471a
      Tom Lane authored
      Document the long forms of \H \i \ir \o \p \r \w ... apparently, we have
      a long and dishonorable history of leaving out the unabbreviated names of
      psql backslash commands.
      
      Avoid saying "Unix shell"; we can just say "shell" with equal clarity,
      and not leave Windows users wondering whether the feature works for them.
      
      Improve consistency of documentation of \g \o \w metacommands.  There's
      no reason to use slightly different wording or markup for each one.
      c61e471a
  21. 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
  22. Aug 30, 2014
  23. Aug 18, 2014
  24. Jul 15, 2014
  25. 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
  26. Mar 25, 2014
  27. Feb 17, 2014
    • 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
  28. Feb 14, 2014
  29. Jan 15, 2014
    • Tom Lane's avatar
      Improve FILES section of psql reference page. · aa00af38
      Tom Lane authored
      Primarily, explain where to find the system-wide psqlrc file, per recent
      gripe from John Sutton.  Do some general wordsmithing and improve the
      markup, too.
      
      Also adjust psqlrc.sample so its comments about file location are somewhat
      trustworthy.  (Not sure why we bother with this file when it's empty,
      but whatever.)
      
      Back-patch to 9.2 where the startup file naming scheme was last changed.
      aa00af38
  30. Nov 13, 2013
  31. Jul 17, 2013
  32. Jul 05, 2013
  33. Jun 20, 2013
  34. Jun 18, 2013
    • Simon Riggs's avatar
      Fix docs on lock level for ALTER TABLE VALIDATE · 20a562f9
      Simon Riggs authored
      ALTER TABLE .. VALIDATE CONSTRAINT previously
      gave incorrect details about lock levels and
      therefore incomplete reasons to use the option.
      
      Initial bug report and fix from Marko Tiikkaja
      Reworded by me to include comments by Kevin Grittner
      20a562f9
  35. Jun 09, 2013
  36. Jun 07, 2013
    • Tom Lane's avatar
      Minor docs wordsmithing. · 58855fbf
      Tom Lane authored
      Swap the order of a couple of phrases to clarify what the adjective
      "subsequent" applies to.
      
      Joshua Tolley
      58855fbf
  37. May 27, 2013
    • Stephen Frost's avatar
      Documentation fix for ALTER TYPE .. RENAME · 02230d3c
      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.
      02230d3c
  38. May 11, 2013
  39. Apr 05, 2013
Loading