[COMMITTERS] pgsql: Correct TABLESAMPLE docs

2016-09-09 Thread Simon Riggs
Correct TABLESAMPLE docs Revert to original use of word “sample”, though with clarification, per Tom Lane. Discussion: [email protected] Branch -- master Details --- http://git.postgresql.org/pg/commitdiff/f66472428a51fc484bc5ca81791924d06a6f096d Modified Files ---

[COMMITTERS] pgsql: Correct TABLESAMPLE docs

2016-09-09 Thread Simon Riggs
Correct TABLESAMPLE docs Revert to original use of word “sample”, though with clarification, per Tom Lane. Discussion: [email protected] Branch -- REL9_6_STABLE Details --- http://git.postgresql.org/pg/commitdiff/9796882e68367a9259b6d5e84bd0a227b579d586 Modified Files

[COMMITTERS] pgsql: Fix VACUUM_TRUNCATE_LOCK_WAIT_INTERVAL

2016-09-09 Thread Simon Riggs
Fix VACUUM_TRUNCATE_LOCK_WAIT_INTERVAL lazy_truncate_heap() was waiting for VACUUM_TRUNCATE_LOCK_WAIT_INTERVAL, but in microseconds not milliseconds as originally intended. Found by code inspection. Simon Riggs Branch -- REL9_5_STABLE Details --- http://git.postgresql.org/pg/commitdiff

[COMMITTERS] pgsql: Fix VACUUM_TRUNCATE_LOCK_WAIT_INTERVAL

2016-09-09 Thread Simon Riggs
Fix VACUUM_TRUNCATE_LOCK_WAIT_INTERVAL lazy_truncate_heap() was waiting for VACUUM_TRUNCATE_LOCK_WAIT_INTERVAL, but in microseconds not milliseconds as originally intended. Found by code inspection. Simon Riggs Branch -- REL9_4_STABLE Details --- http://git.postgresql.org/pg/commitdiff

[COMMITTERS] pgsql: Fix VACUUM_TRUNCATE_LOCK_WAIT_INTERVAL

2016-09-09 Thread Simon Riggs
Fix VACUUM_TRUNCATE_LOCK_WAIT_INTERVAL lazy_truncate_heap() was waiting for VACUUM_TRUNCATE_LOCK_WAIT_INTERVAL, but in microseconds not milliseconds as originally intended. Found by code inspection. Simon Riggs Branch -- REL9_2_STABLE Details --- http://git.postgresql.org/pg/commitdiff

[COMMITTERS] pgsql: Fix VACUUM_TRUNCATE_LOCK_WAIT_INTERVAL

2016-09-09 Thread Simon Riggs
Fix VACUUM_TRUNCATE_LOCK_WAIT_INTERVAL lazy_truncate_heap() was waiting for VACUUM_TRUNCATE_LOCK_WAIT_INTERVAL, but in microseconds not milliseconds as originally intended. Found by code inspection. Simon Riggs Branch -- REL9_6_STABLE Details --- http://git.postgresql.org/pg/commitdiff

[COMMITTERS] pgsql: Fix VACUUM_TRUNCATE_LOCK_WAIT_INTERVAL

2016-09-09 Thread Simon Riggs
Fix VACUUM_TRUNCATE_LOCK_WAIT_INTERVAL lazy_truncate_heap() was waiting for VACUUM_TRUNCATE_LOCK_WAIT_INTERVAL, but in microseconds not milliseconds as originally intended. Found by code inspection. Simon Riggs Branch -- REL9_1_STABLE Details --- http://git.postgresql.org/pg/commitdiff

[COMMITTERS] pgsql: Fix VACUUM_TRUNCATE_LOCK_WAIT_INTERVAL

2016-09-09 Thread Simon Riggs
Fix VACUUM_TRUNCATE_LOCK_WAIT_INTERVAL lazy_truncate_heap() was waiting for VACUUM_TRUNCATE_LOCK_WAIT_INTERVAL, but in microseconds not milliseconds as originally intended. Found by code inspection. Simon Riggs Branch -- REL9_3_STABLE Details --- http://git.postgresql.org/pg/commitdiff

[COMMITTERS] pgsql: Fix corruption of 2PC recovery with subxacts

2016-09-09 Thread Simon Riggs
Fix corruption of 2PC recovery with subxacts Reading 2PC state files during recovery was borked, causing corruptions during recovery. Effect limited to servers with 2PC, subtransactions and recovery/replication. Stas Kelvich, reviewed by Michael Paquier and Pavan Deolasee Branch -- master D

[COMMITTERS] pgsql: Fix corruption of 2PC recovery with subxacts

2016-09-09 Thread Simon Riggs
Fix corruption of 2PC recovery with subxacts Reading 2PC state files during recovery was borked, causing corruptions during recovery. Effect limited to servers with 2PC, subtransactions and recovery/replication. Stas Kelvich, reviewed by Michael Paquier and Pavan Deolasee Branch -- REL9_6_ST

[COMMITTERS] pgsql: Avoid reporting "cache lookup failed" for some user-reachable ca

2016-09-09 Thread Tom Lane
Avoid reporting "cache lookup failed" for some user-reachable cases. We have a not-terribly-thoroughly-enforced-yet project policy that internal errors with SQLSTATE XX000 (ie, plain elog) should not be triggerable from SQL. record_in, domain_in, and PL validator functions all failed to meet this

[COMMITTERS] pgsql: Make better use of existing enums in plpgsql

2016-09-09 Thread Peter Eisentraut
Make better use of existing enums in plpgsql plpgsql.h defines a number of enums, but most of the code passes them around as ints. Update structs and function prototypes to take enum types instead. This clarifies the struct definitions in plpgsql.h in particular. Reviewed-by: Pavel Stehule Br

[COMMITTERS] pgsql: In PageIndexTupleDelete, don't assume stored item lengths are MA

2016-09-09 Thread Tom Lane
In PageIndexTupleDelete, don't assume stored item lengths are MAXALIGNed. PageAddItem stores the item length as-is. It MAXALIGN's the amount of space actually allocated for each tuple, but not the stored length. PageRepairFragmentation, PageIndexMultiDelete, and PageIndexDeleteNoCompact are all o

[COMMITTERS] pgsql: Fix locking a tuple updated by an aborted (sub)transaction

2016-09-09 Thread Alvaro Herrera
Fix locking a tuple updated by an aborted (sub)transaction When heap_lock_tuple decides to follow the update chain, it tried to also lock any version of the tuple that was created by an update that was subsequently rolled back. This is pointless, since for all intents and purposes that tuple exis

[COMMITTERS] pgsql: Fix locking a tuple updated by an aborted (sub)transaction

2016-09-09 Thread Alvaro Herrera
Fix locking a tuple updated by an aborted (sub)transaction When heap_lock_tuple decides to follow the update chain, it tried to also lock any version of the tuple that was created by an update that was subsequently rolled back. This is pointless, since for all intents and purposes that tuple exis

[COMMITTERS] pgsql: Fix locking a tuple updated by an aborted (sub)transaction

2016-09-09 Thread Alvaro Herrera
Fix locking a tuple updated by an aborted (sub)transaction When heap_lock_tuple decides to follow the update chain, it tried to also lock any version of the tuple that was created by an update that was subsequently rolled back. This is pointless, since for all intents and purposes that tuple exis

[COMMITTERS] pgsql: Fix locking a tuple updated by an aborted (sub)transaction

2016-09-09 Thread Alvaro Herrera
Fix locking a tuple updated by an aborted (sub)transaction When heap_lock_tuple decides to follow the update chain, it tried to also lock any version of the tuple that was created by an update that was subsequently rolled back. This is pointless, since for all intents and purposes that tuple exis

[COMMITTERS] pgsql: Fix locking a tuple updated by an aborted (sub)transaction

2016-09-09 Thread Alvaro Herrera
Fix locking a tuple updated by an aborted (sub)transaction When heap_lock_tuple decides to follow the update chain, it tried to also lock any version of the tuple that was created by an update that was subsequently rolled back. This is pointless, since for all intents and purposes that tuple exis

[COMMITTERS] pgsql: Invent PageIndexTupleOverwrite, and teach BRIN and GiST to use i

2016-09-09 Thread Tom Lane
Invent PageIndexTupleOverwrite, and teach BRIN and GiST to use it. PageIndexTupleOverwrite performs approximately the same function as PageIndexTupleDelete (or PageIndexDeleteNoCompact) followed by PageAddItem targeting the same item pointer offset. But in the case where the new tuple is the same

[COMMITTERS] pgsql: Convert PageAddItem into a macro to save a few cycles.

2016-09-09 Thread Tom Lane
Convert PageAddItem into a macro to save a few cycles. Nowadays this is just a backwards-compatibility wrapper around PageAddItemExtended, so let's avoid the extra level of function call. In addition, because pretty much all callers are passing constants for the two bool arguments, compilers will

[COMMITTERS] pgsql: Rewrite PageIndexDeleteNoCompact into a form that only deletes 1

2016-09-09 Thread Tom Lane
Rewrite PageIndexDeleteNoCompact into a form that only deletes 1 tuple. The full generality of deleting an arbitrary number of tuples is no longer needed, so let's save some code and cycles by replacing the original coding with an implementation based on PageIndexTupleDelete. We can always get ba