Skip to content
Snippets Groups Projects
  1. Apr 05, 2013
  2. Mar 03, 2013
  3. 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
  4. Jan 25, 2013
  5. Dec 02, 2012
  6. 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
  7. 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
  8. 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
  9. Oct 17, 2012
  10. 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
  11. 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
  12. Aug 24, 2012
  13. Aug 11, 2012
  14. Aug 04, 2012
  15. Aug 03, 2012
  16. 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
  17. Jul 25, 2012
  18. 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
  19. Jun 22, 2012
  20. Jun 18, 2012
  21. Jun 14, 2012
  22. 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
  23. Jun 11, 2012
  24. Jun 10, 2012
  25. Jun 07, 2012
  26. Jun 05, 2012
  27. May 30, 2012
    • Tom Lane's avatar
      Rewrite --section option to decouple it from --schema-only/--data-only. · 4317e024
      Tom Lane authored
      The initial implementation of pg_dump's --section option supposed that the
      existing --schema-only and --data-only options could be made equivalent to
      --section settings.  This is wrong, though, due to dubious but long since
      set-in-stone decisions about where to dump SEQUENCE SET items, as seen in
      bug report from Martin Pitt.  (And I'm not totally convinced there weren't
      other bugs, either.)  Undo that coupling and instead drive --section
      filtering off current-section state tracked as we scan through the TOC
      list to call _tocEntryRequired().
      
      To make sure those decisions don't shift around and hopefully save a few
      cycles, run _tocEntryRequired() only once per TOC entry and save the result
      in a new TOC field.  This required minor rejiggering of ACL handling but
      also allows a far cleaner implementation of inhibit_data_for_failed_table.
      
      Also, to ensure that pg_dump and pg_restore have the same behavior with
      respect to the --section switches, add _tocEntryRequired() filtering to
      WriteToc() and WriteDataChunks(), rather than trying to implement section
      filtering in an entirely orthogonal way in dumpDumpableObject().  This
      required adjusting the handling of the special ENCODING and STDSTRINGS
      items, but they were pretty weird before anyway.
      
      Minor other code review for the patch, too.
      4317e024
  28. May 27, 2012
  29. May 22, 2012
  30. May 21, 2012
  31. May 20, 2012
    • Peter Eisentraut's avatar
      Some reference page improvements · fe2534e5
      Peter Eisentraut authored
      initdb: Add -T option
      oid2name: Put options in some non-random order
      pg_dump: Put --section option in the right place
      
      And some additional markup and terminology improvements.
      fe2534e5
  32. May 19, 2012
  33. May 15, 2012
  34. May 08, 2012
  35. May 07, 2012
Loading