1. 11 Dec, 2013 7 commits
    • Robert Haas's avatar
      Under wal_level=logical, when saving old tuples, always save OID. · 60dd40bb
      Robert Haas authored
      There's no real point in not doing this.  It doesn't cost anything
      in performance or space.  So let's go wild.
      
      Andres Freund, with substantial editing as to style by me.
      60dd40bb
    • Kevin Grittner's avatar
      Add table name to VACUUM statement in matview.c. · 09df854b
      Kevin Grittner authored
      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
    • Peter Eisentraut's avatar
      PL/Perl: Add event trigger support · e5dc4cc2
      Peter Eisentraut authored
      From: Dimitri Fontaine <dimitri@2ndQuadrant.fr>
      e5dc4cc2
    • Robert Haas's avatar
      Add a new option, -g, to createuser, to add membership in a role. · 6bea96dd
      Robert Haas authored
      Chistopher Browne, reviewed by Sameer Thakur, Amit Kapila, and
      Peter Eisentraut.
      6bea96dd
    • Peter Eisentraut's avatar
      doc: Fix DocBook table column count declaration · a06af436
      Peter Eisentraut authored
      This was broken in d6464fdc.
      a06af436
    • Robert Haas's avatar
      Add a new reloption, user_catalog_table. · 66abc260
      Robert Haas authored
      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
    • Robert Haas's avatar
      Add new wal_level, logical, sufficient for logical decoding. · e55704d8
      Robert Haas authored
      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
  2. 10 Dec, 2013 2 commits
    • Tom Lane's avatar
      Fix possible crash with nested SubLinks. · 9ec6199d
      Tom Lane authored
      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
    • Noah Misch's avatar
      Rename TABLE() to ROWS FROM(). · 53685d79
      Noah Misch authored
      SQL-standard TABLE() is a subset of UNNEST(); they deal with arrays and
      other collection types.  This feature, however, deals with set-returning
      functions.  Use a different syntax for this feature to keep open the
      possibility of implementing the standard TABLE().
      53685d79
  3. 09 Dec, 2013 3 commits
  4. 08 Dec, 2013 2 commits
  5. 07 Dec, 2013 4 commits
    • Magnus Hagander's avatar
      Fix a couple of typos · 54aa5ef7
      Magnus Hagander authored
      Noted by Peter Geoghegan
      54aa5ef7
    • Peter Eisentraut's avatar
      SSL: Support ECDH key exchange · 31647214
      Peter Eisentraut authored
      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: default avatarAdrian Klaver <adrian.klaver@gmail.com>
      31647214
    • Fujii Masao's avatar
      Expose qurey ID in pg_stat_statements view. · 91484409
      Fujii Masao authored
      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
    • Peter Eisentraut's avatar
      SSL: Add configuration option to prefer server cipher order · ef326752
      Peter Eisentraut authored
      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: default avatarAdrian Klaver <adrian.klaver@gmail.com>
      ef326752
  6. 06 Dec, 2013 2 commits
  7. 05 Dec, 2013 3 commits
    • Alvaro Herrera's avatar
      Fix improper abort during update chain locking · 312bde3d
      Alvaro Herrera authored
      In 247c76a9, I added some code to do fine-grained checking of
      MultiXact status of locking/updating transactions when traversing an
      update chain.  There was a thinko in that patch which would have the
      traversing abort, that is return HeapTupleUpdated, when the other
      transaction is a committed lock-only.  In this case we should ignore it
      and return success instead.  Of course, in the case where there is a
      committed update, HeapTupleUpdated is the correct return value.
      
      A user-visible symptom of this bug is that in REPEATABLE READ and
      SERIALIZABLE transaction isolation modes spurious serializability errors
      can occur:
        ERROR:  could not serialize access due to concurrent update
      
      In order for this to happen, there needs to be a tuple that's key-share-
      locked and also updated, and the update must abort; a subsequent
      transaction trying to acquire a new lock on that tuple would abort with
      the above error.  The reason is that the initial FOR KEY SHARE is seen
      as committed by the new locking transaction, which triggers this bug.
      (If the UPDATE commits, then the serialization error is correctly
      reported.)
      
      When running a query in READ COMMITTED mode, what happens is that the
      locking is aborted by the HeapTupleUpdated return value, then
      EvalPlanQual fetches the newest version of the tuple, which is then the
      only version that gets locked.  (The second time the tuple is checked
      there is no misbehavior on the committed lock-only, because it's not
      checked by the code that traverses update chains; so no bug.) Only the
      newest version of the tuple is locked, not older ones, but this is
      harmless.
      
      The isolation test added by this commit illustrates the desired
      behavior, including the proper serialization errors that get thrown.
      
      Backpatch to 9.3.
      312bde3d
    • Tom Lane's avatar
      Clear retry flags properly in replacement OpenSSL sock_write function. · 74242c23
      Tom Lane authored
      Current OpenSSL code includes a BIO_clear_retry_flags() step in the
      sock_write() function.  Either we failed to copy the code correctly, or
      they added this since we copied it.  In any case, lack of the clear step
      appears to be the cause of the server lockup after connection loss reported
      in bug #8647 from Valentine Gogichashvili.  Assume that this is correct
      coding for all OpenSSL versions, and hence back-patch to all supported
      branches.
      
      Diagnosis and patch by Alexander Kukushkin.
      74242c23
    • Alvaro Herrera's avatar
      Avoid resetting Xmax when it's a multi with an aborted update · 07aeb1fe
      Alvaro Herrera authored
      HeapTupleSatisfiesUpdate can very easily "forget" tuple locks while
      checking the contents of a multixact and finding it contains an aborted
      update, by setting the HEAP_XMAX_INVALID bit.  This would lead to
      concurrent transactions not noticing any previous locks held by
      transactions that might still be running, and thus being able to acquire
      subsequent locks they wouldn't be normally able to acquire.
      
      This bug was introduced in commit 1ce150b7; backpatch this fix to 9.3,
      like that commit.
      
      This change reverts the change to the delete-abort-savept isolation test
      in 1ce150b7, because that behavior change was caused by this bug.
      
      Noticed by Andres Freund while investigating a different issue reported
      by Noah Misch.
      07aeb1fe
  8. 04 Dec, 2013 3 commits
  9. 03 Dec, 2013 8 commits
  10. 02 Dec, 2013 6 commits