pgsql: Disallow setting MAX_PARTITION_BUFFERS to less than 2

From: David Rowley <drowley(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Disallow setting MAX_PARTITION_BUFFERS to less than 2
Date: 2024-07-30 08:20:15
Message-ID: E1sYi5f-001ray-9p@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)gmail(dot)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(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Amit Kapila 2024-07-30 09:01:00 pgsql: pg_createsubscriber: Fix an unpredictable recovery wait time.
Previous Message Jeff Davis 2024-07-30 08:13:19 pgsql: Make collation not depend on setlocale().