pgsql: Fix reorder buffer memory accounting for toast changes.

2021-09-12 Thread Amit Kapila
Fix reorder buffer memory accounting for toast changes. While processing toast changes in logical decoding, we rejigger the tuple change to point to in-memory toast tuples instead to on-disk toast tuples. And, to make sure the memory accounting is correct, we were subtracting the old change size a

pgsql: Fix reorder buffer memory accounting for toast changes.

2021-09-12 Thread Amit Kapila
Fix reorder buffer memory accounting for toast changes. While processing toast changes in logical decoding, we rejigger the tuple change to point to in-memory toast tuples instead to on-disk toast tuples. And, to make sure the memory accounting is correct, we were subtracting the old change size a

pgsql: Fix reorder buffer memory accounting for toast changes.

2021-09-12 Thread Amit Kapila
Fix reorder buffer memory accounting for toast changes. While processing toast changes in logical decoding, we rejigger the tuple change to point to in-memory toast tuples instead to on-disk toast tuples. And, to make sure the memory accounting is correct, we were subtracting the old change size a

pgsql: Fix error handling with threads on OOM in ECPG connection logic

2021-09-12 Thread Michael Paquier
Fix error handling with threads on OOM in ECPG connection logic An out-of-memory failure happening when allocating the structures to store the connection parameter keywords and values would mess up with the set of connections saved, as on failure the pthread mutex would still be hold with the new

pgsql: Fix error handling with threads on OOM in ECPG connection logic

2021-09-12 Thread Michael Paquier
Fix error handling with threads on OOM in ECPG connection logic An out-of-memory failure happening when allocating the structures to store the connection parameter keywords and values would mess up with the set of connections saved, as on failure the pthread mutex would still be hold with the new

pgsql: Fix error handling with threads on OOM in ECPG connection logic

2021-09-12 Thread Michael Paquier
Fix error handling with threads on OOM in ECPG connection logic An out-of-memory failure happening when allocating the structures to store the connection parameter keywords and values would mess up with the set of connections saved, as on failure the pthread mutex would still be hold with the new

pgsql: Fix error handling with threads on OOM in ECPG connection logic

2021-09-12 Thread Michael Paquier
Fix error handling with threads on OOM in ECPG connection logic An out-of-memory failure happening when allocating the structures to store the connection parameter keywords and values would mess up with the set of connections saved, as on failure the pthread mutex would still be hold with the new

pgsql: Fix error handling with threads on OOM in ECPG connection logic

2021-09-12 Thread Michael Paquier
Fix error handling with threads on OOM in ECPG connection logic An out-of-memory failure happening when allocating the structures to store the connection parameter keywords and values would mess up with the set of connections saved, as on failure the pthread mutex would still be hold with the new

pgsql: Fix error handling with threads on OOM in ECPG connection logic

2021-09-12 Thread Michael Paquier
Fix error handling with threads on OOM in ECPG connection logic An out-of-memory failure happening when allocating the structures to store the connection parameter keywords and values would mess up with the set of connections saved, as on failure the pthread mutex would still be hold with the new

pgsql: Fix error handling with threads on OOM in ECPG connection logic

2021-09-12 Thread Michael Paquier
Fix error handling with threads on OOM in ECPG connection logic An out-of-memory failure happening when allocating the structures to store the connection parameter keywords and values would mess up with the set of connections saved, as on failure the pthread mutex would still be hold with the new

pgsql: Doc: Change optional parameters grouping in Create Subscription.

2021-09-12 Thread Amit Kapila
Doc: Change optional parameters grouping in Create Subscription. The subscription parameters are rearranged into two groups: a) those that control what happens during Create Subscription b) those that control the replication behavior This makes the documentation of Create Subscription easier to f

pgsql: Add regression tests for csvlog with the logging collector

2021-09-12 Thread Michael Paquier
Add regression tests for csvlog with the logging collector These are added in the existing tests of pg_ctl for log rotation, that already tested stderr. The same amount of coverage is added for csvlog: - Checks for pg_current_logfile(). - Log rotation with expected file name. - Log contents gener

pgsql: Refactor the syslogger pipe protocol to use a bitmask for its op

2021-09-12 Thread Michael Paquier
Refactor the syslogger pipe protocol to use a bitmask for its options The previous protocol expected a set of matching characters to check if a message sent was the last one or not, that changed depending on the destination wanted: - 't' and 'f' tracked the last message of a log sent to stderr. -