Skip to content
Snippets Groups Projects
  1. 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
  2. Feb 14, 2014
  3. 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
  4. Nov 13, 2013
  5. Jul 17, 2013
  6. Jul 05, 2013
  7. Jun 20, 2013
  8. 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
  9. Jun 09, 2013
  10. 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
  11. 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
  12. May 11, 2013
  13. Apr 05, 2013
  14. Mar 03, 2013
  15. Jan 28, 2013
    • Alvaro Herrera's avatar
      DROP OWNED: don't try to drop tablespaces/databases · 2d4e3387
      Alvaro Herrera authored
      My "fix" for bugs #7578 and #6116 on DROP OWNED at fe3b5eb0 not only
      misstated that it applied to REASSIGN OWNED (which it did not affect),
      but it also failed to fix the problems fully, because I didn't test the
      case of owned shared objects.  Thus I created a new bug, reported by
      Thomas Kellerer as #7748, which would cause DROP OWNED to fail with a
      not-for-user-consumption error message.  The code would attempt to drop
      the database, which not only fails to work because the underlying code
      does not support that, but is a pretty dangerous and undesirable thing
      to be doing as well.
      
      This patch fixes that bug by having DROP OWNED only attempt to process
      shared objects when grants on them are found, ignoring ownership.
      
      Backpatch to 8.3, which is as far as the previous bug was backpatched.
      2d4e3387
  16. Jan 25, 2013
  17. Dec 02, 2012
  18. Nov 29, 2012
    • Tom Lane's avatar
      Fix assorted bugs in CREATE/DROP INDEX CONCURRENTLY. · 94c014b5
      Tom Lane authored
      Commit 8cb53654, which introduced DROP
      INDEX CONCURRENTLY, managed to break CREATE INDEX CONCURRENTLY via a poor
      choice of catalog state representation.  The pg_index state for an index
      that's reached the final pre-drop stage was the same as the state for an
      index just created by CREATE INDEX CONCURRENTLY.  This meant that the
      (necessary) change to make RelationGetIndexList ignore about-to-die indexes
      also made it ignore freshly-created indexes; which is catastrophic because
      the latter do need to be considered in HOT-safety decisions.  Failure to
      do so leads to incorrect index entries and subsequently wrong results from
      queries depending on the concurrently-created index.
      
      To fix, make the final state be indisvalid = true and indisready = false,
      which is otherwise nonsensical.  This is pretty ugly but we can't add
      another column without forcing initdb, and it's too late for that in 9.2.
      (There's a cleaner fix in HEAD.)
      
      In addition, change CREATE/DROP INDEX CONCURRENTLY so that the pg_index
      flag changes they make without exclusive lock on the index are made via
      heap_inplace_update() rather than a normal transactional update.  The
      latter is not very safe because moving the pg_index tuple could result in
      concurrent SnapshotNow scans finding it twice or not at all, thus possibly
      resulting in index corruption.  This is a pre-existing bug in CREATE INDEX
      CONCURRENTLY, which was copied into the DROP code.
      
      In addition, fix various places in the code that ought to check to make
      sure that the indexes they are manipulating are valid and/or ready as
      appropriate.  These represent bugs that have existed since 8.2, since
      a failed CREATE INDEX CONCURRENTLY could leave a corrupt or invalid
      index behind, and we ought not try to do anything that might fail with
      such an index.
      
      Also fix RelationReloadIndexInfo to ensure it copies all the pg_index
      columns that are allowed to change after initial creation.  Previously we
      could have been left with stale values of some fields in an index relcache
      entry.  It's not clear whether this actually had any user-visible
      consequences, but it's at least a bug waiting to happen.
      
      In addition, do some code and docs review for DROP INDEX CONCURRENTLY;
      some cosmetic code cleanup but mostly addition and revision of comments.
      
      Portions of this need to be back-patched even further, but I'll work
      on that separately.
      
      Problem reported by Amit Kapila, diagnosis by Pavan Deolasee,
      fix by Tom Lane and Andres Freund.
      94c014b5
  19. Oct 26, 2012
    • Tom Lane's avatar
      In pg_dump, dump SEQUENCE SET items in the data not pre-data section. · 725fa25e
      Tom Lane authored
      Represent a sequence's current value as a separate TableDataInfo dumpable
      object, so that it can be dumped within the data section of the archive
      rather than in pre-data.  This fixes an undesirable inconsistency between
      the meanings of "--data-only" and "--section=data", and also fixes dumping
      of sequences that are marked as extension configuration tables, as per a
      report from Marko Kreen back in July.  The main cost is that we do one more
      SQL query per sequence, but that's probably not very meaningful in most
      databases.
      
      Back-patch to 9.1, since it has the extension configuration issue even
      though not the --section switch.
      725fa25e
  20. Oct 20, 2012
    • Tom Lane's avatar
      Fix pg_dump's handling of DROP DATABASE commands in --clean mode. · a4ef1f09
      Tom Lane authored
      In commit 4317e024, I accidentally broke
      this behavior while rearranging code to ensure that --create wouldn't
      affect whether a DATABASE entry gets put into archive-format output.
      Thus, 9.2 would issue a DROP DATABASE command in --clean mode, which is
      either useless or dangerous depending on the usage scenario.
      It should not do that, and no longer does.
      
      A bright spot is that this refactoring makes it easy to allow the
      combination of --clean and --create to work sensibly, ie, emit DROP
      DATABASE then CREATE DATABASE before reconnecting.  Ordinarily we'd
      consider that a feature addition and not back-patch it, but it seems
      silly to not include the extra couple of lines required in the 9.2
      version of the code.
      
      Per report from Guillaume Lelarge, though this is slightly more extensive
      than his proposed patch.
      a4ef1f09
  21. Oct 17, 2012
  22. Oct 04, 2012
    • Tom Lane's avatar
      Fix permissions explanations in CREATE DATABASE and CREATE SCHEMA docs. · cb4083df
      Tom Lane authored
      These reference pages still claimed that you have to be superuser to create
      a database or schema owned by a different role.  That was true before 8.1,
      but it was changed in commits aa111062 and
      f91370cd to allow assignment of ownership
      to any role you are a member of.  However, at the time we were thinking of
      that primarily as a change to the ALTER OWNER rules, so the need to touch
      these two CREATE ref pages got missed.
      cb4083df
  23. Sep 17, 2012
    • Tom Lane's avatar
      Provide adequate documentation of the "table_name *" notation. · 634d80ab
      Tom Lane authored
      Somewhere along the line, somebody decided to remove all trace of this
      notation from the documentation text.  It was still in the command syntax
      synopses, or at least some of them, but with no indication what it meant.
      This will not do, as evidenced by the confusion apparent in bug #7543;
      even if the notation is now unnecessary, people will find it in legacy
      SQL code and need to know what it does.
      634d80ab
  24. Aug 24, 2012
  25. Aug 11, 2012
  26. Aug 04, 2012
  27. Aug 03, 2012
  28. Jul 31, 2012
    • Alvaro Herrera's avatar
      pg_basebackup: stylistic adjustments · 65f33352
      Alvaro Herrera authored
      The most user-visible part of this is to change the long options
      --statusint and --noloop to --status-interval and --no-loop,
      respectively, per discussion.
      
      Also, consistently enclose file names in double quotes, per our
      conventions; and consistently use the term "transaction log file" to
      talk about WAL segments.  (Someday we may need to go over this
      terminology and make it consistent across the whole source code.)
      
      Finally, reflow the code to better fit in 80 columns, and have pgindent
      fix it up some more.
      65f33352
  29. Jul 25, 2012
  30. Jul 24, 2012
    • Alvaro Herrera's avatar
      Change syntax of new CHECK NO INHERIT constraints · 68043258
      Alvaro Herrera authored
      The initially implemented syntax, "CHECK NO INHERIT (expr)" was not
      deemed very good, so switch to "CHECK (expr) NO INHERIT" instead.  This
      way it looks similar to SQL-standards compliant constraint attribute.
      
      Backport to 9.2 where the new syntax and feature was introduced.
      
      Per discussion.
      68043258
  31. Jun 22, 2012
  32. Jun 18, 2012
  33. Jun 14, 2012
  34. Jun 13, 2012
    • Tom Lane's avatar
      Deprecate use of GLOBAL and LOCAL in temp table creation. · c3bc76bd
      Tom Lane authored
      Aside from adjusting the documentation to say that these are deprecated,
      we now report a warning (not an error) for use of GLOBAL, since it seems
      fairly likely that we might change that to request SQL-spec-compliant temp
      table behavior in the foreseeable future.  Although our handling of LOCAL
      is equally nonstandard, there is no evident interest in ever implementing
      SQL modules, and furthermore some other products interpret LOCAL as
      behaving the same way we do.  So no expectation of change and no warning
      for LOCAL; but it still seems a good idea to deprecate writing it.
      
      Noah Misch
      c3bc76bd
    • Peter Eisentraut's avatar
      Improve documentation of postgres -C option · c0a6f9c8
      Peter Eisentraut authored
      Clarify help (s/return/print/), and explain that this option is for
      use by other programs, not for user-facing use (it does not print
      units).
      c0a6f9c8
  35. Jun 11, 2012
  36. Jun 10, 2012
  37. Jun 07, 2012
Loading