1. 26 1月, 2013 4 次提交
  2. 25 1月, 2013 11 次提交
    • H
      Add prosecdef to \df+ output. · 89368676
      Heikki Linnakangas 提交于
      Jon Erdman, reviewed by Phil Sorber and Stephen Frost.
      89368676
    • B
      doc: improve wording of "foreign data server" in file-fdw docs · 7441b49d
      Bruce Momjian 提交于
      Backpatch to 9.2
      
      Shigeru HANADA
      7441b49d
    • H
      Add some randomness to the choice of which GiST page to insert to. · ba1cc650
      Heikki Linnakangas 提交于
      When descending the tree for an insert, and there are multiple equally good
      pages we could insert to, make the choice in random. Previously, we would
      always choose the tuple with lowest offset number. That meant that when two
      non-leaf pages overlap - in the extreme case they might have exactly the same
      key - all but the first such page went unused. That wasn't optimal for space
      usage; if you deleted some tuples from the non-first pages, the space would
      never be reused.
      
      With this patch, the other pages are sometimes chosen too, although there's
      still a heavy bias towards low-offset tuples, so that we don't lose cache
      locality when doing a lot of inserts with similar keys.
      
      Original idea by Alexander Korotkov, although this patch version was written
      by me and copy-edited by Tom Lane.
      ba1cc650
    • M
      Make pg_dump exclude unlogged table data on hot standby slaves · be926474
      Magnus Hagander 提交于
      Noted by Joe Van Dyk
      be926474
    • T
      Fix concat() and format() to handle VARIADIC-labeled arguments correctly. · 760f3c04
      Tom Lane 提交于
      Previously, the VARIADIC labeling was effectively ignored, but now these
      functions act as though the array elements had all been given as separate
      arguments.
      
      Pavel Stehule
      760f3c04
    • B
      doc: add mention of ssi read anomolies to mvcc docs · 56a6317b
      Bruce Momjian 提交于
      From Jeff Davis, modified by Kevin Grittner
      56a6317b
    • B
      doc: correct sepgsql doc about permission checking of CASCADE · 9971f6f5
      Bruce Momjian 提交于
      Backpatch to 9.2.
      
      Patch from Kohei KaiGai
      9971f6f5
    • T
      Fix SPI documentation for new handling of ExecutorRun's count parameter. · 2ddc600f
      Tom Lane 提交于
      Since 9.0, the count parameter has only limited the number of tuples
      actually returned by the executor.  It doesn't affect the behavior of
      INSERT/UPDATE/DELETE unless RETURNING is specified, because without
      RETURNING, the ModifyTable plan node doesn't return control to execMain.c
      for each tuple.  And we only check the limit at the top level.
      
      While this behavioral change was unintentional at the time, discussion of
      bug #6572 led us to the conclusion that we prefer the new behavior anyway,
      and so we should just adjust the docs to match rather than change the code.
      Accordingly, do that.  Back-patch as far as 9.0 so that the docs match the
      code in each branch.
      2ddc600f
    • A
      Use correct output device for Windows prompts. · 1068771a
      Andrew Dunstan 提交于
      This ensures that mapping of non-ascii prompts
      to the correct code page occurs.
      
      Bug report and original patch from Alexander Law,
      reviewed and reworked by Noah Misch.
      
      Backpatch to all live branches.
      1068771a
    • B
      pg_upgrade: detect stale postmaster.pid lock files · a9ceaa53
      Bruce Momjian 提交于
      If the postmaster.pid lock file exists, try starting/stopping the
      cluster to check if the lock file is valid.
      
      Per request from Tom.
      a9ceaa53
    • A
      Redefine HEAP_XMAX_IS_LOCKED_ONLY · 74ebba84
      Alvaro Herrera 提交于
      Tuples marked SELECT FOR UPDATE in a cluster that's later processed by
      pg_upgrade would have a different infomask bit pattern than those
      produced by 9.3dev; that bit pattern was being seen as "dead" by HEAD
      (because they would fail the "is this tuple locked" test, and so the
      visibility rules would thing they're updated, even though there's no
      HEAP_UPDATED version of them).  In other words, some rows could silently
      disappear after pg_upgrade.
      
      With this new definition, those tuples become visible again.
      
      This is breakage resulting from my commit 0ac5ad51.
      74ebba84
  3. 24 1月, 2013 11 次提交
  4. 23 1月, 2013 10 次提交
    • 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
    • R
      Further documentation tweaks for event triggers. · f925c79b
      Robert Haas 提交于
      Per discussion between Dimitri Fontaine, myself, and others.
      f925c79b
    • R
      601e2935
    • H
      Implement pg_unreachable() on MSVC. · 52906f17
      Heikki Linnakangas 提交于
      52906f17
    • A
      Gitignore vcxproj files. · eaf76484
      Andrew Dunstan 提交于
      Per request from Craig Ringer.
      eaf76484
    • H
      Fix more issues with cascading replication and timeline switches. · 990fe3c4
      Heikki Linnakangas 提交于
      When a standby server follows the master using WAL archive, and it chooses
      a new timeline (recovery_target_timeline='latest'), it only fetches the
      timeline history file for the chosen target timeline, not any other history
      files that might be missing from pg_xlog. For example, if the current
      timeline is 2, and we choose 4 as the new recovery target timeline, the
      history file for timeline 3 is not fetched, even if it's part of this
      server's history. That's enough for the standby itself - the history file
      for timeline 4 includes timeline 3 as well - but if a cascading standby
      server wants to recover to timeline 3, it needs the history file. To fix,
      when a new recovery target timeline is chosen, try to copy any missing
      history files from the archive to pg_xlog between the old and new target
      timeline.
      
      A second similar issue was with the WAL files. When a standby recovers from
      archive, and it reaches a segment that contains a switch to a new timeline,
      recovery fetches only the WAL file labelled with the new timeline's ID. The
      file from the new timeline contains a copy of the WAL from the old timeline
      up to the point where the switch happened, and recovery recovers it from the
      new file. But in streaming replication, walsender only tries to read it
      from the old timeline's file. To fix, change walsender to read it from the
      new file, so that it behaves the same as recovery in that sense, and doesn't
      try to open the possibly nonexistent file with the old timeline's ID.
      990fe3c4
    • 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
    • P
      doc: Fix declared number of columns in table · 21c87a0d
      Peter Eisentraut 提交于
      This was broken in 841a5150.
      21c87a0d
    • R
      Fix a few small bugs in yesterday's event trigger patch. · ddef9a00
      Robert Haas 提交于
      Dimitri Fontaine
      ddef9a00
    • R
      Fix CREATE EVENT TRIGGER syntax synopsis in documentation. · 4c977319
      Robert Haas 提交于
      Dimitri Fontaine, per a report from Thom Brown
      4c977319
  5. 22 1月, 2013 3 次提交
    • R
      Typo fixes. · 9917a491
      Robert Haas 提交于
      Noted by Thom Brown.
      9917a491
    • T
      Add infrastructure for storing a VARIADIC ANY function's VARIADIC flag. · 75b39e79
      Tom Lane 提交于
      Originally we didn't bother to mark FuncExprs with any indication whether
      VARIADIC had been given in the source text, because there didn't seem to be
      any need for it at runtime.  However, because we cannot fold a VARIADIC ANY
      function's arguments into an array (since they're not necessarily all the
      same type), we do actually need that information at runtime if VARIADIC ANY
      functions are to respond unsurprisingly to use of the VARIADIC keyword.
      Add the missing field, and also fix ruleutils.c so that VARIADIC ANY
      function calls are dumped properly.
      
      Extracted from a larger patch that also fixes concat() and format() (the
      only two extant VARIADIC ANY functions) to behave properly when VARIADIC is
      specified.  This portion seems appropriate to review and commit separately.
      
      Pavel Stehule
      75b39e79
    • R
      Add ddl_command_end support for event triggers. · 841a5150
      Robert Haas 提交于
      Dimitri Fontaine, with slight changes by me
      841a5150
  6. 21 1月, 2013 1 次提交
    • A
      Refactor ALTER some-obj RENAME implementation · 765cbfdc
      Alvaro Herrera 提交于
      Remove duplicate implementations of catalog munging and miscellaneous
      privilege checks.  Instead rely on already existing data in
      objectaddress.c to do the work.
      
      Author: KaiGai Kohei, changes by me
      Reviewed by: Robert Haas, Álvaro Herrera, Dimitri Fontaine
      765cbfdc