1. 15 12月, 2013 1 次提交
    • T
      Fix inherited UPDATE/DELETE with UNION ALL subqueries. · c03ad560
      Tom Lane 提交于
      Fix an oversight in commit b3aaf908: we do
      indeed need to process the planner's append_rel_list when copying RTE
      subqueries, because if any of them were flattenable UNION ALL subqueries,
      the append_rel_list shows which subquery RTEs were pulled up out of which
      other ones.  Without this, UNION ALL subqueries aren't correctly inserted
      into the update plans for inheritance child tables after the first one,
      typically resulting in no update happening for those child table(s).
      Per report from Victor Yegorov.
      
      Experimentation with this case also exposed a fault in commit
      a7b96538: if an inherited UPDATE/DELETE
      was proven totally dummy by constraint exclusion, we might arrive at
      add_rtes_to_flat_rtable with root->simple_rel_array being NULL.  This
      should be interpreted as not having any RelOptInfos.  I chose to code
      the guard as a check against simple_rel_array_size, so as to also
      provide some protection against indexing off the end of the array.
      
      Back-patch to 9.2 where the faulty code was added.
      c03ad560
  2. 14 12月, 2013 5 次提交
    • A
      Fix typo · 60eea378
      Alvaro Herrera 提交于
      60eea378
    • A
      Rework MultiXactId cache code · d881dd62
      Alvaro Herrera 提交于
      The original performs too poorly; in some scenarios it shows way too
      high while profiling.  Try to make it a bit smarter to avoid excessive
      cosst.  In particular, make it have a maximum size, and have entries be
      sorted in LRU order; once the max size is reached, evict the oldest
      entry to avoid it from growing too large.
      
      Per complaint from Andres Freund in connection with new tuple freezing
      code.
      d881dd62
    • T
      Add HOLD/RESUME_INTERRUPTS in HandleCatchupInterrupt/HandleNotifyInterrupt. · 2efc6dc2
      Tom Lane 提交于
      This prevents a possible longjmp out of the signal handler if a timeout
      or SIGINT occurs while something within the handler has transiently set
      ImmediateInterruptOK.  For safety we must hold off the timeout or cancel
      error until we're back in mainline, or at least till we reach the end of
      the signal handler when ImmediateInterruptOK was true at entry.  This
      syncs these functions with the logic now present in handle_sig_alarm.
      
      AFAICT there is no live bug here in 9.0 and up, because I don't think we
      currently can wait for any heavyweight lock inside these functions, and
      there is no other code (except read-from-client) that will turn on
      ImmediateInterruptOK.  However, that was not true pre-9.0: in older
      branches ProcessIncomingNotify might block trying to lock pg_listener, and
      then a SIGINT could lead to undesirable control flow.  It might be all
      right anyway given the relatively narrow code ranges in which NOTIFY
      interrupts are enabled, but for safety's sake I'm back-patching this.
      2efc6dc2
    • H
      Fix more instances of "the the" in comments. · dde62825
      Heikki Linnakangas 提交于
      Plus one instance of "to to" in the docs.
      dde62825
    • T
      Don't let timeout interrupts happen unless ImmediateInterruptOK is set. · e8312b4f
      Tom Lane 提交于
      Serious oversight in commit 16e1b7a1:
      we should not allow an interrupt to take control away from mainline code
      except when ImmediateInterruptOK is set.  Just to be safe, let's adopt
      the same save-clear-restore dance that's been used for many years in
      HandleCatchupInterrupt and HandleNotifyInterrupt, so that nothing bad
      happens if a timeout handler invokes code that tests or even manipulates
      ImmediateInterruptOK.
      
      Per report of "stuck spinlock" failures from Christophe Pettus, though
      many other symptoms are possible.  Diagnosis by Andres Freund.
      e8312b4f
  3. 13 12月, 2013 6 次提交
  4. 12 12月, 2013 10 次提交
  5. 11 12月, 2013 7 次提交
    • K
      Add table name to VACUUM statement in matview.c. · 09df854b
      Kevin Grittner 提交于
      The test only needs the one table to be vacuumed.  Vacuuming the
      database may affect other tests.
      
      Per gripe from Tom Lane.  Back-patch to 9.3, where the test was
      was added.
      09df854b
    • P
      PL/Perl: Add event trigger support · e5dc4cc2
      Peter Eisentraut 提交于
      From: Dimitri Fontaine <dimitri@2ndQuadrant.fr>
      e5dc4cc2
    • R
      Add a new option, -g, to createuser, to add membership in a role. · 6bea96dd
      Robert Haas 提交于
      Chistopher Browne, reviewed by Sameer Thakur, Amit Kapila, and
      Peter Eisentraut.
      6bea96dd
    • P
      doc: Fix DocBook table column count declaration · a06af436
      Peter Eisentraut 提交于
      This was broken in d6464fdc.
      a06af436
    • R
      Add a new reloption, user_catalog_table. · 66abc260
      Robert Haas 提交于
      When this reloption is set and wal_level=logical is configured,
      we'll record the CIDs stamped by inserts, updates, and deletes to
      the table just as we would for an actual catalog table.  This will
      allow logical decoding to use historical MVCC snapshots to access
      such tables just as they access ordinary catalog tables.
      
      Replication solutions built around the logical decoding machinery
      will likely need to set this operation for their configuration
      tables; it might also be needed by extensions which perform table
      access in their output functions.
      
      Andres Freund, reviewed by myself and others.
      66abc260
    • R
      Add new wal_level, logical, sufficient for logical decoding. · e55704d8
      Robert Haas 提交于
      When wal_level=logical, we'll log columns from the old tuple as
      configured by the REPLICA IDENTITY facility added in commit
      07cacba9.  This makes it possible
      a properly-configured logical replication solution to correctly
      follow table updates even if they change the chosen key columns,
      or, with REPLICA IDENTITY FULL, even if the table has no key at
      all.  Note that updates which do not modify the replica identity
      column won't log anything extra, making the choice of a good key
      (i.e. one that will rarely be changed) important to performance
      when wal_level=logical is configured.
      
      Each insert, update, or delete to a catalog table will also log
      the CMIN and/or CMAX values of stamped by the current transaction.
      This is necessary because logical decoding will require access to
      historical snapshots of the catalog in order to decode some data
      types, and the CMIN/CMAX values that we may need in order to judge
      row visibility may have been overwritten by the time we need them.
      
      Andres Freund, reviewed in various versions by myself, Heikki
      Linnakangas, KONDO Mitsumasa, and many others.
      e55704d8
    • T
      Fix possible crash with nested SubLinks. · 9ec6199d
      Tom Lane 提交于
      An expression such as WHERE (... x IN (SELECT ...) ...) IN (SELECT ...)
      could produce an invalid plan that results in a crash at execution time,
      if the planner attempts to flatten the outer IN into a semi-join.
      This happens because convert_testexpr() was not expecting any nested
      SubLinks and would wrongly replace any PARAM_SUBLINK Params belonging
      to the inner SubLink.  (I think the comment denying that this case could
      happen was wrong when written; it's certainly been wrong for quite a long
      time, since very early versions of the semijoin flattening logic.)
      
      Per report from Teodor Sigaev.  Back-patch to all supported branches.
      9ec6199d
  6. 10 12月, 2013 4 次提交
  7. 08 12月, 2013 5 次提交
    • M
      Fix pg_stat_statements build on 32-bit systems · 33d3f559
      Magnus Hagander 提交于
      Peter Geoghegan
      33d3f559
    • J
      Fix performance regression in dblink connection speed. · d6ca510d
      Joe Conway 提交于
      Previous commit e5de6012 modified dblink
      to ensure client encoding matched the server. However the added
      PQsetClientEncoding() call added significant overhead. Restore original
      performance in the common case where client encoding already matches
      server encoding by doing nothing in that case. Applies to all active
      branches.
      
      Issue reported and work sponsored by Zonar Systems.
      d6ca510d
    • M
      Fix a couple of typos · 54aa5ef7
      Magnus Hagander 提交于
      Noted by Peter Geoghegan
      54aa5ef7
    • P
      SSL: Support ECDH key exchange · 31647214
      Peter Eisentraut 提交于
      This sets up ECDH key exchange, when compiling against OpenSSL that
      supports EC.  Then the ECDHE-RSA and ECDHE-ECDSA cipher suites can be
      used for SSL connections.  The latter one means that EC keys are now
      usable.
      
      The reason for EC key exchange is that it's faster than DHE and it
      allows to go to higher security levels where RSA will be horribly slow.
      
      There is also new GUC option ssl_ecdh_curve that specifies the curve
      name used for ECDH.  It defaults to "prime256v1", which is the most
      common curve in use in HTTPS.
      
      From: Marko Kreen <markokr@gmail.com>
      Reviewed-by: NAdrian Klaver <adrian.klaver@gmail.com>
      31647214
    • F
      Expose qurey ID in pg_stat_statements view. · 91484409
      Fujii Masao 提交于
      The query ID is the internal hash identifier of the statement,
      and was not available in pg_stat_statements view so far.
      
      Daniel Farina, Sameer Thakur and Peter Geoghegan, reviewed by me.
      91484409
  8. 07 12月, 2013 1 次提交
    • P
      SSL: Add configuration option to prefer server cipher order · ef326752
      Peter Eisentraut 提交于
      By default, OpenSSL (and SSL/TLS in general) lets the client cipher
      order take priority.  This is OK for browsers where the ciphers were
      tuned, but few PostgreSQL client libraries make the cipher order
      configurable.  So it makes sense to have the cipher order in
      postgresql.conf take priority over client defaults.
      
      This patch adds the setting "ssl_prefer_server_ciphers" that can be
      turned on so that server cipher order is preferred.  Per discussion,
      this now defaults to on.
      
      From: Marko Kreen <markokr@gmail.com>
      Reviewed-by: NAdrian Klaver <adrian.klaver@gmail.com>
      ef326752
  9. 06 12月, 2013 1 次提交