pgsql: Extend the logical decoding output plugin API with stream method

2020-07-27 Thread Amit Kapila
Extend the logical decoding output plugin API with stream methods. This adds seven methods to the output plugin API, adding support for streaming changes of large in-progress transactions. * stream_start * stream_stop * stream_abort * stream_commit * stream_change * stream_message * stream_trunca

pgsql: doc: Mention the rename of wal_keep_segments GUC in release note

2020-07-27 Thread Fujii Masao
doc: Mention the rename of wal_keep_segments GUC in release note. Commit f5dff45962 renamed wal_keep_segments to wal_keep_size. This commit adds the mention to this change in the release note. Author: Fujii Masao Reviewed-by: David Steele Discussion: https://postgr.es/m/dc4768f2-1eff-d2fc-35ba-6

pgsql: Fix some issues with step generation in partition pruning.

2020-07-27 Thread Etsuro Fujita
Fix some issues with step generation in partition pruning. In the case of range partitioning, get_steps_using_prefix() assumes that the passed-in prefix list contains at least one clause for each of the partition keys earlier than one specified in the passed-in step_lastkeyno, but the caller (ie,

pgsql: Fix some issues with step generation in partition pruning.

2020-07-27 Thread Etsuro Fujita
Fix some issues with step generation in partition pruning. In the case of range partitioning, get_steps_using_prefix() assumes that the passed-in prefix list contains at least one clause for each of the partition keys earlier than one specified in the passed-in step_lastkeyno, but the caller (ie,

pgsql: Fix some issues with step generation in partition pruning.

2020-07-27 Thread Etsuro Fujita
Fix some issues with step generation in partition pruning. In the case of range partitioning, get_steps_using_prefix() assumes that the passed-in prefix list contains at least one clause for each of the partition keys earlier than one specified in the passed-in step_lastkeyno, but the caller (ie,

pgsql: Fix some issues with step generation in partition pruning.

2020-07-27 Thread Etsuro Fujita
Fix some issues with step generation in partition pruning. In the case of range partitioning, get_steps_using_prefix() assumes that the passed-in prefix list contains at least one clause for each of the partition keys earlier than one specified in the passed-in step_lastkeyno, but the caller (ie,

pgsql: Remove hashagg_avoid_disk_plan GUC.

2020-07-27 Thread Peter Geoghegan
Remove hashagg_avoid_disk_plan GUC. Note: This GUC was originally named enable_hashagg_disk when it appeared in commit 1f39bce0, which added disk-based hash aggregation. It was subsequently renamed in commit 92c58fd9. Author: Peter Geoghegan Reviewed-By: Jeff Davis, Álvaro Herrera Discussion: h

pgsql: Remove hashagg_avoid_disk_plan GUC.

2020-07-27 Thread Peter Geoghegan
Remove hashagg_avoid_disk_plan GUC. Note: This GUC was originally named enable_hashagg_disk when it appeared in commit 1f39bce0, which added disk-based hash aggregation. It was subsequently renamed in commit 92c58fd9. Author: Peter Geoghegan Reviewed-By: Jeff Davis, Álvaro Herrera Discussion: h

Re: determine what column(s) form the primary key, in C extention

2020-07-27 Thread David Rowley
Hi Alex, On Tue, 28 Jul 2020 at 05:47, alex maslakov wrote: > I was suggested to use `get_primary_key_attnos` from > `src/include/catalog/pg_constraint.h` > > extern Bitmapset *get_primary_key_attnos(Oid relid, bool deferrableOk) > > > It returns *Bitstamp. And it's got "nwords" and "words[]". Bu

determine what column(s) form the primary key, in C extention

2020-07-27 Thread alex maslakov
Hey. I'm creating an extention in C. An extention will be fired as, or inside, a trigger. What I need: dynamically, inside a trigger, identify which column, or columns if the primary key is composed of multiple columns, form the primary key -- their indexes or names. I need a fast way, there

pgsql: Fix LookupTupleHashEntryHash() pipeline-stall issue.

2020-07-27 Thread Jeff Davis
Fix LookupTupleHashEntryHash() pipeline-stall issue. Refactor hash lookups in nodeAgg.c to improve performance. Author: Andres Freund and Jeff Davis Discussion: https://postgr.es/m/20200612213715.op4ye4q7gktqvpuo%40alap3.anarazel.de Backpatch-through: 13 Branch -- master Details --- ht

pgsql: Fix LookupTupleHashEntryHash() pipeline-stall issue.

2020-07-27 Thread Jeff Davis
Fix LookupTupleHashEntryHash() pipeline-stall issue. Refactor hash lookups in nodeAgg.c to improve performance. Author: Andres Freund and Jeff Davis Discussion: https://postgr.es/m/20200612213715.op4ye4q7gktqvpuo%40alap3.anarazel.de Backpatch-through: 13 Branch -- REL_13_STABLE Details ---

pgsql: Fix corner case with 16kB-long decompression in pgcrypto, take 2

2020-07-27 Thread Michael Paquier
Fix corner case with 16kB-long decompression in pgcrypto, take 2 A compressed stream may end with an empty packet. In this case decompression finishes before reading the empty packet and the remaining stream packet causes a failure in reading the following data. This commit makes sure to consume

pgsql: Fix corner case with 16kB-long decompression in pgcrypto, take 2

2020-07-27 Thread Michael Paquier
Fix corner case with 16kB-long decompression in pgcrypto, take 2 A compressed stream may end with an empty packet. In this case decompression finishes before reading the empty packet and the remaining stream packet causes a failure in reading the following data. This commit makes sure to consume

pgsql: Fix corner case with 16kB-long decompression in pgcrypto, take 2

2020-07-27 Thread Michael Paquier
Fix corner case with 16kB-long decompression in pgcrypto, take 2 A compressed stream may end with an empty packet. In this case decompression finishes before reading the empty packet and the remaining stream packet causes a failure in reading the following data. This commit makes sure to consume

pgsql: Fix corner case with 16kB-long decompression in pgcrypto, take 2

2020-07-27 Thread Michael Paquier
Fix corner case with 16kB-long decompression in pgcrypto, take 2 A compressed stream may end with an empty packet. In this case decompression finishes before reading the empty packet and the remaining stream packet causes a failure in reading the following data. This commit makes sure to consume

pgsql: Fix corner case with 16kB-long decompression in pgcrypto, take 2

2020-07-27 Thread Michael Paquier
Fix corner case with 16kB-long decompression in pgcrypto, take 2 A compressed stream may end with an empty packet. In this case decompression finishes before reading the empty packet and the remaining stream packet causes a failure in reading the following data. This commit makes sure to consume

pgsql: Fix corner case with 16kB-long decompression in pgcrypto, take 2

2020-07-27 Thread Michael Paquier
Fix corner case with 16kB-long decompression in pgcrypto, take 2 A compressed stream may end with an empty packet. In this case decompression finishes before reading the empty packet and the remaining stream packet causes a failure in reading the following data. This commit makes sure to consume

pgsql: Fix corner case with 16kB-long decompression in pgcrypto, take 2

2020-07-27 Thread Michael Paquier
Fix corner case with 16kB-long decompression in pgcrypto, take 2 A compressed stream may end with an empty packet. In this case decompression finishes before reading the empty packet and the remaining stream packet causes a failure in reading the following data. This commit makes sure to consume