pgsql: Disallow setting MAX_PARTITION_BUFFERS to less than 2 - Mailing list pgsql-committers

From David Rowley
Subject pgsql: Disallow setting MAX_PARTITION_BUFFERS to less than 2
Date
Msg-id E1sYi5f-001ray-9p@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Disallow setting MAX_PARTITION_BUFFERS to less than 2

Add some comments to mention that this value must be at least 2 and also
add a StaticAssertDecl to cause compilation failure if anyone tries to
build with an invalid value.

The multiInsertBuffers list must have at least two elements due to how the
code in CopyMultiInsertInfoFlush() pushes the current ResultRelInfo's
CopyMultiInsertBuffer to the end of the list.  If the first element is
also the last element, bad things will happen.

Author: Zhang Mingli <avamingli@gmail.com>
Discussion: https://postgr.es/m/CAApHDvpQ6t9ROcqbD-OgqR04Kfq4vQKw79Vo6r5j%2BciHwsSfkA%40mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/c19615fe391c9577e2129fed4429736f6b5295da

Modified Files
--------------
src/backend/commands/copyfrom.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)


pgsql-committers by date:

Previous
From: Jeff Davis
Date:
Subject: pgsql: Make collation not depend on setlocale().
Next
From: Amit Kapila
Date:
Subject: pgsql: pg_createsubscriber: Fix an unpredictable recovery wait time.