pgsql: Avoid overflow in fe_utils' printTable()

2023-11-21 Thread Alvaro Herrera
Avoid overflow in fe_utils' printTable()

The original code would miscalculate the total number of cells when the
table to print has more than ~4 billion cells, leading to an unnecessary
error.  Repair by changing some computations to be 64-bits wide.  Add
some necessary overflow checks.

Author: Hongxu Ma 
Discussion: 
https://postgr.es/m/tybp286mb0351b057b101c90d7c1239e6b4...@tybp286mb0351.jpnp286.prod.outlook.com

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/24ea53dcfab7fe463c0cf56095e9fe5d23cdb748

Modified Files
--
src/fe_utils/print.c | 30 ++
src/include/fe_utils/print.h |  2 +-
2 files changed, 23 insertions(+), 9 deletions(-)



pgsql: Remove unneeded assignments in for loop header

2023-11-21 Thread Alvaro Herrera
Remove unneeded assignments in for loop header

The last use of this variable in the loop body was removed by commit
93df658a0189.

Branch
--
master

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

Modified Files
--
src/fe_utils/print.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)



pgsql: doc: vacuum_cost_limit controls when vacuum_cost_delay happens

2023-11-21 Thread Bruce Momjian
doc:  vacuum_cost_limit controls when vacuum_cost_delay happens

Mention this relationship.

Reported-by: Martín Marqués

Discussion: 
https://postgr.es/m/cabeg9ltsavp4waknguyo-haiiowcb8xejqvddfhx_nfi5sj...@mail.gmail.com

Author: Martín Marqués

Backpatch-through: master

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/3af101ce8be8eeb0e8adc61e293b5d12989f68be

Modified Files
--
doc/src/sgml/config.sgml | 8 
1 file changed, 4 insertions(+), 4 deletions(-)



pgsql: Fix query checking consistency of table amhandlers in opr_sanity

2023-11-21 Thread Michael Paquier
Fix query checking consistency of table amhandlers in opr_sanity.sql

As written, the query checked for an access method of type 's', which is
not an AM type supported in the core code.

Error introduced by 8586bf7ed888.  As this query is not checking what it
should, backpatch all the way down.

Reviewed-by: Aleksander Alekseev
Discussion: https://postgr.es/m/[email protected]
Backpatch-through: 12

Branch
--
REL_13_STABLE

Details
---
https://git.postgresql.org/pg/commitdiff/5747f68ae2cb2fd0d66939f5343f83a5e474a166

Modified Files
--
src/test/regress/expected/opr_sanity.out | 2 +-
src/test/regress/sql/opr_sanity.sql  | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)



pgsql: Fix query checking consistency of table amhandlers in opr_sanity

2023-11-21 Thread Michael Paquier
Fix query checking consistency of table amhandlers in opr_sanity.sql

As written, the query checked for an access method of type 's', which is
not an AM type supported in the core code.

Error introduced by 8586bf7ed888.  As this query is not checking what it
should, backpatch all the way down.

Reviewed-by: Aleksander Alekseev
Discussion: https://postgr.es/m/[email protected]
Backpatch-through: 12

Branch
--
REL_14_STABLE

Details
---
https://git.postgresql.org/pg/commitdiff/3dadeef5d9ffe94deac926d7266a2ec64795e159

Modified Files
--
src/test/regress/expected/opr_sanity.out | 2 +-
src/test/regress/sql/opr_sanity.sql  | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)



pgsql: Fix query checking consistency of table amhandlers in opr_sanity

2023-11-21 Thread Michael Paquier
Fix query checking consistency of table amhandlers in opr_sanity.sql

As written, the query checked for an access method of type 's', which is
not an AM type supported in the core code.

Error introduced by 8586bf7ed888.  As this query is not checking what it
should, backpatch all the way down.

Reviewed-by: Aleksander Alekseev
Discussion: https://postgr.es/m/[email protected]
Backpatch-through: 12

Branch
--
REL_12_STABLE

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

Modified Files
--
src/test/regress/expected/opr_sanity.out | 2 +-
src/test/regress/sql/opr_sanity.sql  | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)



pgsql: Fix query checking consistency of table amhandlers in opr_sanity

2023-11-21 Thread Michael Paquier
Fix query checking consistency of table amhandlers in opr_sanity.sql

As written, the query checked for an access method of type 's', which is
not an AM type supported in the core code.

Error introduced by 8586bf7ed888.  As this query is not checking what it
should, backpatch all the way down.

Reviewed-by: Aleksander Alekseev
Discussion: https://postgr.es/m/[email protected]
Backpatch-through: 12

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/2f30226624b0645913ea832c15b10b0de43bc7c4

Modified Files
--
src/test/regress/expected/opr_sanity.out | 2 +-
src/test/regress/sql/opr_sanity.sql  | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)



pgsql: Fix query checking consistency of table amhandlers in opr_sanity

2023-11-21 Thread Michael Paquier
Fix query checking consistency of table amhandlers in opr_sanity.sql

As written, the query checked for an access method of type 's', which is
not an AM type supported in the core code.

Error introduced by 8586bf7ed888.  As this query is not checking what it
should, backpatch all the way down.

Reviewed-by: Aleksander Alekseev
Discussion: https://postgr.es/m/[email protected]
Backpatch-through: 12

Branch
--
REL_15_STABLE

Details
---
https://git.postgresql.org/pg/commitdiff/63e045c2dcf53eb56d2851acc1236c31f3098a95

Modified Files
--
src/test/regress/expected/opr_sanity.out | 2 +-
src/test/regress/sql/opr_sanity.sql  | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)



pgsql: Fix query checking consistency of table amhandlers in opr_sanity

2023-11-21 Thread Michael Paquier
Fix query checking consistency of table amhandlers in opr_sanity.sql

As written, the query checked for an access method of type 's', which is
not an AM type supported in the core code.

Error introduced by 8586bf7ed888.  As this query is not checking what it
should, backpatch all the way down.

Reviewed-by: Aleksander Alekseev
Discussion: https://postgr.es/m/[email protected]
Backpatch-through: 12

Branch
--
REL_16_STABLE

Details
---
https://git.postgresql.org/pg/commitdiff/43bbaa83f95cd5f66e556ca521b7c22d80be571d

Modified Files
--
src/test/regress/expected/opr_sanity.out | 2 +-
src/test/regress/sql/opr_sanity.sql  | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)



pgsql: doc: FreeBSD uses camcontrol identify, not atacontrol, for cache

2023-11-21 Thread Bruce Momjian
doc: FreeBSD uses camcontrol identify, not atacontrol, for cache

This is for IDE drive cache control, same as SCSI (already documented
properly).

Reported-by: John Ekins

Discussion: 
https://postgr.es/m/[email protected]

Author: John Ekins

Backpatch-through: 12

Branch
--
REL_15_STABLE

Details
---
https://git.postgresql.org/pg/commitdiff/4e64be6520dbc67febbf8ecd8fe28bad06c0255c

Modified Files
--
doc/src/sgml/wal.sgml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)



pgsql: doc: FreeBSD uses camcontrol identify, not atacontrol, for cache

2023-11-21 Thread Bruce Momjian
doc: FreeBSD uses camcontrol identify, not atacontrol, for cache

This is for IDE drive cache control, same as SCSI (already documented
properly).

Reported-by: John Ekins

Discussion: 
https://postgr.es/m/[email protected]

Author: John Ekins

Backpatch-through: 12

Branch
--
master

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

Modified Files
--
doc/src/sgml/wal.sgml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)



pgsql: doc: FreeBSD uses camcontrol identify, not atacontrol, for cache

2023-11-21 Thread Bruce Momjian
doc: FreeBSD uses camcontrol identify, not atacontrol, for cache

This is for IDE drive cache control, same as SCSI (already documented
properly).

Reported-by: John Ekins

Discussion: 
https://postgr.es/m/[email protected]

Author: John Ekins

Backpatch-through: 12

Branch
--
REL_13_STABLE

Details
---
https://git.postgresql.org/pg/commitdiff/50d3f09b6ea4d78245c68461941cf624cc900d51

Modified Files
--
doc/src/sgml/wal.sgml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)



pgsql: doc: FreeBSD uses camcontrol identify, not atacontrol, for cache

2023-11-21 Thread Bruce Momjian
doc: FreeBSD uses camcontrol identify, not atacontrol, for cache

This is for IDE drive cache control, same as SCSI (already documented
properly).

Reported-by: John Ekins

Discussion: 
https://postgr.es/m/[email protected]

Author: John Ekins

Backpatch-through: 12

Branch
--
REL_16_STABLE

Details
---
https://git.postgresql.org/pg/commitdiff/9bbdffadf757346b64973e568d2e6ef2b755d99d

Modified Files
--
doc/src/sgml/wal.sgml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)



pgsql: doc: FreeBSD uses camcontrol identify, not atacontrol, for cache

2023-11-21 Thread Bruce Momjian
doc: FreeBSD uses camcontrol identify, not atacontrol, for cache

This is for IDE drive cache control, same as SCSI (already documented
properly).

Reported-by: John Ekins

Discussion: 
https://postgr.es/m/[email protected]

Author: John Ekins

Backpatch-through: 12

Branch
--
REL_12_STABLE

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

Modified Files
--
doc/src/sgml/wal.sgml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)



pgsql: doc: FreeBSD uses camcontrol identify, not atacontrol, for cache

2023-11-21 Thread Bruce Momjian
doc: FreeBSD uses camcontrol identify, not atacontrol, for cache

This is for IDE drive cache control, same as SCSI (already documented
properly).

Reported-by: John Ekins

Discussion: 
https://postgr.es/m/[email protected]

Author: John Ekins

Backpatch-through: 12

Branch
--
REL_14_STABLE

Details
---
https://git.postgresql.org/pg/commitdiff/4af8cf35ce22803d3abf2908c2506e5793b734e3

Modified Files
--
doc/src/sgml/wal.sgml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)



pgsql: Stop the search once the slot for replication origin is found.

2023-11-21 Thread Amit Kapila
Stop the search once the slot for replication origin is found.

In replorigin_session_setup(), we were needlessly looping for
max_replication_slots even after finding an existing slot for the origin.
This shouldn't hurt us much except for probably large values of
max_replication_slots.

Author: Antonin Houska
Discussion: http://postgr.es/m/2694.1700471273@antos

Branch
--
master

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

Modified Files
--
src/backend/replication/logical/origin.c | 1 +
1 file changed, 1 insertion(+)



pgsql: Fix the initial sync tables with no columns.

2023-11-21 Thread Amit Kapila
Fix the initial sync tables with no columns.

The copy command formed for initial sync was using parenthesis for tables
with no columns leading to syntax error. This patch avoids adding
parenthesis for such tables.

Reported-by: Justin G
Author: Vignesh C
Reviewed-by: Peter Smith, Amit Kapila
Backpatch-through: 15
Discussion: http://postgr.es/m/[email protected]

Branch
--
REL_16_STABLE

Details
---
https://git.postgresql.org/pg/commitdiff/1b6da28e0668eb977dcab6987d192ddedf32b752

Modified Files
--
src/backend/replication/logical/tablesync.c | 28 ++--
src/test/subscription/t/001_rep_changes.pl  | 17 -
2 files changed, 34 insertions(+), 11 deletions(-)



pgsql: Fix the initial sync tables with no columns.

2023-11-21 Thread Amit Kapila
Fix the initial sync tables with no columns.

The copy command formed for initial sync was using parenthesis for tables
with no columns leading to syntax error. This patch avoids adding
parenthesis for such tables.

Reported-by: Justin G
Author: Vignesh C
Reviewed-by: Peter Smith, Amit Kapila
Backpatch-through: 15
Discussion: http://postgr.es/m/[email protected]

Branch
--
REL_15_STABLE

Details
---
https://git.postgresql.org/pg/commitdiff/57aae65aee2626143055349954024b678c92bb11

Modified Files
--
src/backend/replication/logical/tablesync.c | 28 ++--
src/test/subscription/t/001_rep_changes.pl  | 17 -
2 files changed, 34 insertions(+), 11 deletions(-)



pgsql: Fix the initial sync tables with no columns.

2023-11-21 Thread Amit Kapila
Fix the initial sync tables with no columns.

The copy command formed for initial sync was using parenthesis for tables
with no columns leading to syntax error. This patch avoids adding
parenthesis for such tables.

Reported-by: Justin G
Author: Vignesh C
Reviewed-by: Peter Smith, Amit Kapila
Backpatch-through: 15
Discussion: http://postgr.es/m/[email protected]

Branch
--
master

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

Modified Files
--
src/backend/replication/logical/tablesync.c | 28 ++--
src/test/subscription/t/001_rep_changes.pl  | 17 -
2 files changed, 34 insertions(+), 11 deletions(-)