pgsql: Move Perl test modules to a better namespace

2021-10-24 Thread Andrew Dunstan
Move Perl test modules to a better namespace The five modules in our TAP test framework all had names in the top level namespace. This is unwise because, even though we're not exporting them to CPAN, the names can leak, for example if they are exported by the RPM build process. We therefore move t

pgsql: Fix minor memory leaks in pg_dump.

2021-10-24 Thread Tom Lane
Fix minor memory leaks in pg_dump. I found these by running pg_dump under "valgrind --leak-check=full". The changes in flagInhIndexes() and getIndexes() replace allocation of an array of which we use only some elements by individual allocations of just the actually-needed objects. The previous c

pgsql: Add replication command READ_REPLICATION_SLOT

2021-10-24 Thread Michael Paquier
Add replication command READ_REPLICATION_SLOT The command is supported for physical slots for now, and returns the type of slot, its restart_lsn and its restart_tli. This will be useful for an upcoming patch related to pg_receivewal, to allow the tool to be able to stream from the position of a s

pgsql: Clarify the logic in a few places in the new balanced merge code

2021-10-24 Thread Heikki Linnakangas
Clarify the logic in a few places in the new balanced merge code. In selectnewtape(), use 'nOutputTapes' rather than 'nOutputRuns' in the check for whether to start a new tape or to append a new run to an existing tape. Until 'maxTapes' is reached, nOutputTapes is always equal to nOutputRuns, so i