1. 30 4月, 2013 4 次提交
  2. 18 4月, 2013 1 次提交
  3. 31 3月, 2013 2 次提交
    • B
      pg_upgrade: don't copy/link files for invalid indexes · 203d8ae2
      Bruce Momjian 提交于
      Now that pg_dump no longer dumps invalid indexes, per commit
      683abc73, have pg_upgrade also skip
      them.  Previously pg_upgrade threw an error if invalid indexes existed.
      
      Backpatch to 9.2, 9.1, and 9.0 (where pg_upgrade was added to git)
      203d8ae2
    • A
      Avoid moving data directory in upgrade testing. · 67eb3e50
      Andrew Dunstan 提交于
      Windows sometimes gets upset if we rename a large directory and then try
      to use the old name quickly, as seen in occasional buildfarm failures.
      So we avoid that by building the old version in the intended
      destination in the first place instead of renaming it, similar to the
      change made for the same reason in commit b7f8465c.
      67eb3e50
  4. 22 3月, 2013 1 次提交
    • S
      Allow I/O reliability checks using 16-bit checksums · 96ef3b8f
      Simon Riggs 提交于
      Checksums are set immediately prior to flush out of shared buffers
      and checked when pages are read in again. Hint bit setting will
      require full page write when block is dirtied, which causes various
      infrastructure changes. Extensive comments, docs and README.
      
      WARNING message thrown if checksum fails on non-all zeroes page;
      ERROR thrown but can be disabled with ignore_checksum_failure = on.
      
      Feature enabled by an initdb option, since transition from option off
      to option on is long and complex and has not yet been implemented.
      Default is not to use checksums.
      
      Checksum used is WAL CRC-32 truncated to 16-bits.
      
      Simon Riggs, Jeff Davis, Greg Smith
      Wide input and assistance from many community members. Thank you.
      96ef3b8f
  5. 04 3月, 2013 1 次提交
    • K
      Add a materialized view relations. · 3bf3ab8c
      Kevin Grittner 提交于
      A materialized view has a rule just like a view and a heap and
      other physical properties like a table.  The rule is only used to
      populate the table, references in queries refer to the
      materialized data.
      
      This is a minimal implementation, but should still be useful in
      many cases.  Currently data is only populated "on demand" by the
      CREATE MATERIALIZED VIEW and REFRESH MATERIALIZED VIEW statements.
      It is expected that future releases will add incremental updates
      with various timings, and that a more refined concept of defining
      what is "fresh" data will be developed.  At some point it may even
      be possible to have queries use a materialized in place of
      references to underlying tables, but that requires the other
      above-mentioned features to be working first.
      
      Much of the documentation work by Robert Haas.
      Review by Noah Misch, Thom Brown, Robert Haas, Marko Tiikkaja
      Security review by KaiGai Kohei, with a decision on how best to
      implement sepgsql still pending.
      3bf3ab8c
  6. 01 3月, 2013 1 次提交
  7. 14 2月, 2013 2 次提交
  8. 12 2月, 2013 1 次提交
    • A
      Create libpgcommon, and move pg_malloc et al to it · 8396447c
      Alvaro Herrera 提交于
      libpgcommon is a new static library to allow sharing code among the
      various frontend programs and backend; this lets us eliminate duplicate
      implementations of common routines.  We avoid libpgport, because that's
      intended as a place for porting issues; per discussion, it seems better
      to keep them separate.
      
      The first use case, and the only implemented by this patch, is pg_malloc
      and friends, which many frontend programs were already using.
      
      At the same time, we can use this to provide palloc emulation functions
      for the frontend; this way, some palloc-using files in the backend can
      also be used by the frontend cleanly.  To do this, we change palloc() in
      the backend to be a function instead of a macro on top of
      MemoryContextAlloc().  This was previously believed to cause loss of
      performance, but this implementation has been tweaked by Tom and Andres
      so that on modern compilers it provides a slight improvement over the
      previous one.
      
      This lets us clean up some places that were already with
      localized hacks.
      
      Most of the pg_malloc/palloc changes in this patch were authored by
      Andres Freund. Zoltán Böszörményi also independently provided a form of
      that.  libpgcommon infrastructure was authored by Álvaro.
      8396447c
  9. 25 1月, 2013 1 次提交
  10. 24 1月, 2013 3 次提交
  11. 23 1月, 2013 2 次提交
    • A
      Improve concurrency of foreign key locking · 0ac5ad51
      Alvaro Herrera 提交于
      This patch introduces two additional lock modes for tuples: "SELECT FOR
      KEY SHARE" and "SELECT FOR NO KEY UPDATE".  These don't block each
      other, in contrast with already existing "SELECT FOR SHARE" and "SELECT
      FOR UPDATE".  UPDATE commands that do not modify the values stored in
      the columns that are part of the key of the tuple now grab a SELECT FOR
      NO KEY UPDATE lock on the tuple, allowing them to proceed concurrently
      with tuple locks of the FOR KEY SHARE variety.
      
      Foreign key triggers now use FOR KEY SHARE instead of FOR SHARE; this
      means the concurrency improvement applies to them, which is the whole
      point of this patch.
      
      The added tuple lock semantics require some rejiggering of the multixact
      module, so that the locking level that each transaction is holding can
      be stored alongside its Xid.  Also, multixacts now need to persist
      across server restarts and crashes, because they can now represent not
      only tuple locks, but also tuple updates.  This means we need more
      careful tracking of lifetime of pg_multixact SLRU files; since they now
      persist longer, we require more infrastructure to figure out when they
      can be removed.  pg_upgrade also needs to be careful to copy
      pg_multixact files over from the old server to the new, or at least part
      of multixact.c state, depending on the versions of the old and new
      servers.
      
      Tuple time qualification rules (HeapTupleSatisfies routines) need to be
      careful not to consider tuples with the "is multi" infomask bit set as
      being only locked; they might need to look up MultiXact values (i.e.
      possibly do pg_multixact I/O) to find out the Xid that updated a tuple,
      whereas they previously were assured to only use information readily
      available from the tuple header.  This is considered acceptable, because
      the extra I/O would involve cases that would previously cause some
      commands to block waiting for concurrent transactions to finish.
      
      Another important change is the fact that locking tuples that have
      previously been updated causes the future versions to be marked as
      locked, too; this is essential for correctness of foreign key checks.
      This causes additional WAL-logging, also (there was previously a single
      WAL record for a locked tuple; now there are as many as updated copies
      of the tuple there exist.)
      
      With all this in place, contention related to tuples being checked by
      foreign key rules should be much reduced.
      
      As a bonus, the old behavior that a subtransaction grabbing a stronger
      tuple lock than the parent (sub)transaction held on a given tuple and
      later aborting caused the weaker lock to be lost, has been fixed.
      
      Many new spec files were added for isolation tester framework, to ensure
      overall behavior is sane.  There's probably room for several more tests.
      
      There were several reviewers of this patch; in particular, Noah Misch
      and Andres Freund spent considerable time in it.  Original idea for the
      patch came from Simon Riggs, after a problem report by Joel Jacobson.
      Most code is from me, with contributions from Marti Raudsepp, Alexander
      Shulgin, Noah Misch and Andres Freund.
      
      This patch was discussed in several pgsql-hackers threads; the most
      important start at the following message-ids:
      	AANLkTimo9XVcEzfiBR-ut3KVNDkjm2Vxh+t8kAmWjPuv@mail.gmail.com
      	1290721684-sup-3951@alvh.no-ip.org
      	1294953201-sup-2099@alvh.no-ip.org
      	1320343602-sup-2290@alvh.no-ip.org
      	1339690386-sup-8927@alvh.no-ip.org
      	4FE5FF020200002500048A3D@gw.wicourts.gov
      	4FEAB90A0200002500048B7D@gw.wicourts.gov
      0ac5ad51
    • B
      pg_upgrade: remove --single-transaction usage · 861ad67b
      Bruce Momjian 提交于
      With AtEOXact applied, --single-transaction makes pg_restore slower, and
      has the potential to require lock table configuration, so remove the
      argument.
      
      Per suggestion from Tom.
      861ad67b
  12. 18 1月, 2013 1 次提交
  13. 12 1月, 2013 1 次提交
    • A
      Extend and improve use of EXTRA_REGRESS_OPTS. · 4ae5ee6c
      Andrew Dunstan 提交于
      This is now used by ecpg tests, and not clobbered by pg_upgrade
      tests. This change won't affect anything that doesn't set this
      environment variable, but will enable the buildfarm to control
      exactly what port regression test installs will be running on,
      and thus to detect possible rogue postmasters more easily.
      
      Backpatch to release 9.2 where EXTRA_REGRESS_OPTS was first used.
      4ae5ee6c
  14. 09 1月, 2013 1 次提交
  15. 04 1月, 2013 1 次提交
    • T
      Prevent creation of postmaster's TCP socket during pg_upgrade testing. · 78a5e738
      Tom Lane 提交于
      On non-Windows machines, we use the Unix socket for connections to test
      postmasters, so there is no need to create a TCP socket.  Furthermore,
      doing so causes failures due to port conflicts if two builds are carried
      out concurrently on one machine.  (If the builds are done in different
      chroots, which is standard practice at least in Red Hat distros, there
      is no risk of conflict on the Unix socket.)  Suppressing the TCP socket
      by setting listen_addresses to empty has long been standard practice
      for pg_regress, and pg_upgrade knows about this too ... but pg_upgrade's
      test.sh didn't get the memo.
      
      Back-patch to 9.2, and also sync the 9.2 version of the script with HEAD
      as much as practical.
      78a5e738
  16. 03 1月, 2013 1 次提交
  17. 02 1月, 2013 1 次提交
  18. 27 12月, 2012 1 次提交
  19. 21 12月, 2012 1 次提交
    • B
      Avoid using NAMEDATALEN in pg_upgrade · dc9896a2
      Bruce Momjian 提交于
      Because the client encoding might not match the server encoding,
      pg_upgrade can't allocate NAMEDATALEN bytes for storage of database,
      relation, and namespace identifiers.  Instead pg_strdup() the memory and
      free it.
      
      Also add C comment in initdb.c about safe NAMEDATALEN usage.
      dc9896a2
  20. 20 12月, 2012 1 次提交
  21. 12 12月, 2012 1 次提交
    • B
      Fix pg_upgrade for invalid indexes · e95c4bd1
      Bruce Momjian 提交于
      All versions of pg_upgrade upgraded invalid indexes caused by CREATE
      INDEX CONCURRENTLY failures and marked them as valid.  The patch adds a
      check to all pg_upgrade versions and throws an error during upgrade or
      --check.
      
      Backpatch to 9.2, 9.1, 9.0.  Patch slightly adjusted.
      e95c4bd1
  22. 11 12月, 2012 1 次提交
    • B
      Fix pg_upgrade -O/-o options · acdb8c22
      Bruce Momjian 提交于
      Fix previous commit that added synchronous_commit=off, but broke -O/-o
      due to missing space in argument passing.
      
      Backpatch to 9.2.
      acdb8c22
  23. 08 12月, 2012 1 次提交
    • B
      Improve pg_upgrade's status display · 6dd95845
      Bruce Momjian 提交于
      Pg_upgrade displays file names during copy and database names during
      dump/restore.  Andrew Dunstan identified three bugs:
      
      *  long file names were being truncated to 60 _leading_ characters, which
         often do not change for long file names
      
      *  file names were truncated to 60 characters in log files
      
      *  carriage returns were being output to log files
      
      This commit fixes these --- it prints 60 _trailing_ characters to the
      status display, and full path names without carriage returns to log
      files.  It also suppresses status output to the log file unless verbose
      mode is used.
      6dd95845
  24. 04 12月, 2012 6 次提交
  25. 02 12月, 2012 1 次提交
  26. 01 12月, 2012 2 次提交