Skip to content
Snippets Groups Projects
  1. Jan 27, 2013
  2. Jan 26, 2013
    • Tom Lane's avatar
      Make LATERAL implicit for functions in FROM. · 2378d79a
      Tom Lane authored
      The SQL standard does not have general functions-in-FROM, but it does
      allow UNNEST() there (see the <collection derived table> production),
      and the semantics of that are defined to include lateral references.
      So spec compliance requires allowing lateral references within UNNEST()
      even without an explicit LATERAL keyword.  Rather than making UNNEST()
      a special case, it seems best to extend this flexibility to any
      function-in-FROM.  We'll still allow LATERAL to be written explicitly
      for clarity's sake, but it's now a noise word in this context.
      
      In theory this change could result in a change in behavior of existing
      queries, by allowing what had been an outer reference in a function-in-FROM
      to be captured by an earlier FROM-item at the same level.  However, all
      pre-9.3 PG releases have a bug that causes them to match variable
      references to earlier FROM-items in preference to outer references (and
      then throw an error).  So no previously-working query could contain the
      type of ambiguity that would risk a change of behavior.
      
      Per a suggestion from Andrew Gierth, though I didn't use his patch.
      2378d79a
    • Bruce Momjian's avatar
      Update comments in new DROP IF EXISTS code; commit message update · 8865fe0a
      Bruce Momjian authored
      DROP IF EXISTS with a missing schema in commit
      7e2322df applies not only to tables, but
      to DROP IF EXISTS with missing schemas for indexes, views, sequences,
      and foreign tables.  Yeah!
      8865fe0a
    • Bruce Momjian's avatar
      Update LookupExplicitNamespace() comments; commit message update · 51cfb87a
      Bruce Momjian authored
      Also, commit 7e2322df affected DROP
      TABLE IF EXISTS, not CREATE TABLE IF EXISTS.
      51cfb87a
    • Bruce Momjian's avatar
      Issue ERROR if FREEZE mode can't be honored by COPY · 4deb57de
      Bruce Momjian authored
      Previously non-honored FREEZE mode was ignored.  This also issues an
      appropriate error message based on the cause of the failure, per
      suggestion from Tom.  Additional regression test case added.
      4deb57de
    • Bruce Momjian's avatar
      Allow CREATE TABLE IF EXIST so succeed if the schema is nonexistent · 7e2322df
      Bruce Momjian authored
      Previously, CREATE TABLE IF EXIST threw an error if the schema was
      nonexistent.  This was done by passing 'missing_ok' to the function that
      looks up the schema oid.
      7e2322df
    • Bruce Momjian's avatar
      doc: revert 80c20fcf and · 7c83619b
      Bruce Momjian authored
      0e93959a
      
      Revert patch that modified doc index mentions of search_path
      
      Per Peter E.
      7c83619b
  3. Jan 25, 2013
  4. Jan 24, 2013
  5. Jan 23, 2013
    • Alvaro Herrera's avatar
      isolationtester: add a few fflush(stderr) calls · ca5db759
      Alvaro Herrera authored
      The lack of them is causing failures in some BF members.
      
      Per Andrew Dunstan.
      ca5db759
    • Robert Haas's avatar
      Clarify that connection parameters aren't totally meaningless for PQping. · 40ed59b2
      Robert Haas authored
      Per discussion with Phil Sorber.
      40ed59b2
    • Robert Haas's avatar
      pg_isready · ac2e9673
      Robert Haas authored
      New command-line utility to test whether a server is ready to
      accept connections.
      
      Phil Sorber, reviewed by Michael Paquier and Peter Eisentraut
      ac2e9673
    • Alvaro Herrera's avatar
      Improve concurrency of foreign key locking · 0ac5ad51
      Alvaro Herrera authored
      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
    • Robert Haas's avatar
      Further documentation tweaks for event triggers. · f925c79b
      Robert Haas authored
      Per discussion between Dimitri Fontaine, myself, and others.
      f925c79b
    • Robert Haas's avatar
Loading