pgsql: Don't use elog() in src/port/pwrite.c.

2021-01-12 Thread Thomas Munro
Don't use elog() in src/port/pwrite.c. Nothing broke because of this oversight yet, but it would fail to link if we tried to use pg_pwrite() in frontend code on a system that lacks pwrite(). Use an assertion instead. Also pgindent while here. Discussion: https://postgr.es/m/CA%2BhUKGL57RvoQsS3

pgsql: Fix memory leak in SnapBuildSerialize.

2021-01-12 Thread Amit Kapila
Fix memory leak in SnapBuildSerialize. The memory for the snapshot was leaked while serializing it to disk during logical decoding. This memory will be freed only once walsender stops streaming the changes. This can lead to a huge memory increase when master logs Standby Snapshot too frequently sa

pgsql: Fix memory leak in SnapBuildSerialize.

2021-01-12 Thread Amit Kapila
Fix memory leak in SnapBuildSerialize. The memory for the snapshot was leaked while serializing it to disk during logical decoding. This memory will be freed only once walsender stops streaming the changes. This can lead to a huge memory increase when master logs Standby Snapshot too frequently sa

pgsql: Fix memory leak in SnapBuildSerialize.

2021-01-12 Thread Amit Kapila
Fix memory leak in SnapBuildSerialize. The memory for the snapshot was leaked while serializing it to disk during logical decoding. This memory will be freed only once walsender stops streaming the changes. This can lead to a huge memory increase when master logs Standby Snapshot too frequently sa

pgsql: Fix memory leak in SnapBuildSerialize.

2021-01-12 Thread Amit Kapila
Fix memory leak in SnapBuildSerialize. The memory for the snapshot was leaked while serializing it to disk during logical decoding. This memory will be freed only once walsender stops streaming the changes. This can lead to a huge memory increase when master logs Standby Snapshot too frequently sa

pgsql: Fix memory leak in SnapBuildSerialize.

2021-01-12 Thread Amit Kapila
Fix memory leak in SnapBuildSerialize. The memory for the snapshot was leaked while serializing it to disk during logical decoding. This memory will be freed only once walsender stops streaming the changes. This can lead to a huge memory increase when master logs Standby Snapshot too frequently sa

pgsql: Fix memory leak in SnapBuildSerialize.

2021-01-12 Thread Amit Kapila
Fix memory leak in SnapBuildSerialize. The memory for the snapshot was leaked while serializing it to disk during logical decoding. This memory will be freed only once walsender stops streaming the changes. This can lead to a huge memory increase when master logs Standby Snapshot too frequently sa

pgsql: Fix memory leak in SnapBuildSerialize.

2021-01-12 Thread Amit Kapila
Fix memory leak in SnapBuildSerialize. The memory for the snapshot was leaked while serializing it to disk during logical decoding. This memory will be freed only once walsender stops streaming the changes. This can lead to a huge memory increase when master logs Standby Snapshot too frequently sa

pgsql: Optimize DropRelFileNodesAllBuffers() for recovery.

2021-01-12 Thread Amit Kapila
Optimize DropRelFileNodesAllBuffers() for recovery. Similar to commit d6ad34f341, this patch optimizes DropRelFileNodesAllBuffers() by avoiding the complete buffer pool scan and instead find the buffers to be invalidated by doing lookups in the BufMapping table. This optimization helps operations

pgsql: Fix routine name in comment of catcache.c

2021-01-12 Thread Michael Paquier
Fix routine name in comment of catcache.c Author: Bharath Rupireddy Discussion: https://postgr.es/m/calj2acudxlakf_xxqo9tautntngi3lmd8fand+vbjbchn1h...@mail.gmail.com Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/fce7d0e6efbef304e81846c75eddf73099628d10 Modified

pgsql: Invent struct ReindexIndexInfo

2021-01-12 Thread Alvaro Herrera
Invent struct ReindexIndexInfo This struct is used by ReindexRelationConcurrently to keep track of the relations to process. This saves having to obtain some data repeatedly, and has future uses as well. Reviewed-by: Dmitry Dolgov <[email protected]> Reviewed-by: Hamid Akhtar Reviewed-by: M

pgsql: pg_dump: label INDEX ATTACH ArchiveEntries with an owner.

2021-01-12 Thread Tom Lane
pg_dump: label INDEX ATTACH ArchiveEntries with an owner. Although a partitioned index's attachment to its parent doesn't have separate ownership, the ArchiveEntry for it needs to be marked with an owner anyway, to ensure that the ALTER command is run by the appropriate role when restoring with --

pgsql: pg_dump: label INDEX ATTACH ArchiveEntries with an owner.

2021-01-12 Thread Tom Lane
pg_dump: label INDEX ATTACH ArchiveEntries with an owner. Although a partitioned index's attachment to its parent doesn't have separate ownership, the ArchiveEntry for it needs to be marked with an owner anyway, to ensure that the ALTER command is run by the appropriate role when restoring with --

pgsql: pg_dump: label INDEX ATTACH ArchiveEntries with an owner.

2021-01-12 Thread Tom Lane
pg_dump: label INDEX ATTACH ArchiveEntries with an owner. Although a partitioned index's attachment to its parent doesn't have separate ownership, the ArchiveEntry for it needs to be marked with an owner anyway, to ensure that the ALTER command is run by the appropriate role when restoring with --

pgsql: pg_dump: label INDEX ATTACH ArchiveEntries with an owner.

2021-01-12 Thread Tom Lane
pg_dump: label INDEX ATTACH ArchiveEntries with an owner. Although a partitioned index's attachment to its parent doesn't have separate ownership, the ArchiveEntry for it needs to be marked with an owner anyway, to ensure that the ALTER command is run by the appropriate role when restoring with --

pgsql: Doc: fix description of privileges needed for ALTER PUBLICATION.

2021-01-12 Thread Tom Lane
Doc: fix description of privileges needed for ALTER PUBLICATION. Adding a table to a publication requires ownership of the table (in addition to ownership of the publication). This was mentioned nowhere. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/cc865c0f319fd

pgsql: Doc: fix description of privileges needed for ALTER PUBLICATION.

2021-01-12 Thread Tom Lane
Doc: fix description of privileges needed for ALTER PUBLICATION. Adding a table to a publication requires ownership of the table (in addition to ownership of the publication). This was mentioned nowhere. Branch -- REL_11_STABLE Details --- https://git.postgresql.org/pg/commitdiff/57404f

pgsql: Doc: fix description of privileges needed for ALTER PUBLICATION.

2021-01-12 Thread Tom Lane
Doc: fix description of privileges needed for ALTER PUBLICATION. Adding a table to a publication requires ownership of the table (in addition to ownership of the publication). This was mentioned nowhere. Branch -- REL_12_STABLE Details --- https://git.postgresql.org/pg/commitdiff/a2768e

pgsql: Doc: fix description of privileges needed for ALTER PUBLICATION.

2021-01-12 Thread Tom Lane
Doc: fix description of privileges needed for ALTER PUBLICATION. Adding a table to a publication requires ownership of the table (in addition to ownership of the publication). This was mentioned nowhere. Branch -- REL_13_STABLE Details --- https://git.postgresql.org/pg/commitdiff/0725bf

pgsql: Doc: fix description of privileges needed for ALTER PUBLICATION.

2021-01-12 Thread Tom Lane
Doc: fix description of privileges needed for ALTER PUBLICATION. Adding a table to a publication requires ownership of the table (in addition to ownership of the publication). This was mentioned nowhere. Branch -- REL_10_STABLE Details --- https://git.postgresql.org/pg/commitdiff/a2c5a4

pgsql: Fix thinko in comment

2021-01-12 Thread Alvaro Herrera
Fix thinko in comment This comment has been wrong since its introduction in commit 2c03216d8311. Author: Masahiko Sawada Discussion: https://postgr.es/m/cad21aoazz6qipfjbbgeahmywxvvndp8httbwlr9tuqwatju...@mail.gmail.com Branch -- REL_10_STABLE Details --- https://git.postgresql.org/pg

pgsql: Fix thinko in comment

2021-01-12 Thread Alvaro Herrera
Fix thinko in comment This comment has been wrong since its introduction in commit 2c03216d8311. Author: Masahiko Sawada Discussion: https://postgr.es/m/cad21aoazz6qipfjbbgeahmywxvvndp8httbwlr9tuqwatju...@mail.gmail.com Branch -- REL_12_STABLE Details --- https://git.postgresql.org/pg

pgsql: Fix thinko in comment

2021-01-12 Thread Alvaro Herrera
Fix thinko in comment This comment has been wrong since its introduction in commit 2c03216d8311. Author: Masahiko Sawada Discussion: https://postgr.es/m/cad21aoazz6qipfjbbgeahmywxvvndp8httbwlr9tuqwatju...@mail.gmail.com Branch -- REL9_6_STABLE Details --- https://git.postgresql.org/pg

pgsql: Fix thinko in comment

2021-01-12 Thread Alvaro Herrera
Fix thinko in comment This comment has been wrong since its introduction in commit 2c03216d8311. Author: Masahiko Sawada Discussion: https://postgr.es/m/cad21aoazz6qipfjbbgeahmywxvvndp8httbwlr9tuqwatju...@mail.gmail.com Branch -- REL_13_STABLE Details --- https://git.postgresql.org/pg

pgsql: Fix thinko in comment

2021-01-12 Thread Alvaro Herrera
Fix thinko in comment This comment has been wrong since its introduction in commit 2c03216d8311. Author: Masahiko Sawada Discussion: https://postgr.es/m/cad21aoazz6qipfjbbgeahmywxvvndp8httbwlr9tuqwatju...@mail.gmail.com Branch -- REL9_5_STABLE Details --- https://git.postgresql.org/pg

pgsql: Fix thinko in comment

2021-01-12 Thread Alvaro Herrera
Fix thinko in comment This comment has been wrong since its introduction in commit 2c03216d8311. Author: Masahiko Sawada Discussion: https://postgr.es/m/cad21aoazz6qipfjbbgeahmywxvvndp8httbwlr9tuqwatju...@mail.gmail.com Branch -- REL_11_STABLE Details --- https://git.postgresql.org/pg

pgsql: Fix thinko in comment

2021-01-12 Thread Alvaro Herrera
Fix thinko in comment This comment has been wrong since its introduction in commit 2c03216d8311. Author: Masahiko Sawada Discussion: https://postgr.es/m/cad21aoazz6qipfjbbgeahmywxvvndp8httbwlr9tuqwatju...@mail.gmail.com Branch -- master Details --- https://git.postgresql.org/pg/commit