pgsql: Fix warnings on Windows.

2022-07-19 Thread Thomas Munro
Fix warnings on Windows. Avoid macro redefinition warnings. Reported-by: David Rowley Discussion: https://postgr.es/m/CAApHDvocHp4SXcPeMTwFiCQGaf9JypjTJ3Bh90jcPuGwxyDjjQ%40mail.gmail.com Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/bde60daa0ec9d0ee8dc79c0caa2c

pgsql: Fix assertion failure and segmentation fault in backup code.

2022-07-19 Thread Fujii Masao
Fix assertion failure and segmentation fault in backup code. When a non-exclusive backup is canceled, do_pg_abort_backup() is called and resets some variables set by pg_backup_start (pg_start_backup in v14 or before). But previously it forgot to reset the session state indicating whether a non-exc

pgsql: Prevent BASE_BACKUP in the middle of another backup in the same

2022-07-19 Thread Fujii Masao
Prevent BASE_BACKUP in the middle of another backup in the same session. Multiple non-exclusive backups are able to be run conrrently in different sessions. But, in the same session, only one non-exclusive backup can be run at the same moment. If pg_backup_start (pg_start_backup in v14 or before)

pgsql: Fix assertion failure and segmentation fault in backup code.

2022-07-19 Thread Fujii Masao
Fix assertion failure and segmentation fault in backup code. When a non-exclusive backup is canceled, do_pg_abort_backup() is called and resets some variables set by pg_backup_start (pg_start_backup in v14 or before). But previously it forgot to reset the session state indicating whether a non-exc

pgsql: Prevent BASE_BACKUP in the middle of another backup in the same

2022-07-19 Thread Fujii Masao
Prevent BASE_BACKUP in the middle of another backup in the same session. Multiple non-exclusive backups are able to be run conrrently in different sessions. But, in the same session, only one non-exclusive backup can be run at the same moment. If pg_backup_start (pg_start_backup in v14 or before)

pgsql: Fix assertion failure and segmentation fault in backup code.

2022-07-19 Thread Fujii Masao
Fix assertion failure and segmentation fault in backup code. When a non-exclusive backup is canceled, do_pg_abort_backup() is called and resets some variables set by pg_backup_start (pg_start_backup in v14 or before). But previously it forgot to reset the session state indicating whether a non-exc

pgsql: Prevent BASE_BACKUP in the middle of another backup in the same

2022-07-19 Thread Fujii Masao
Prevent BASE_BACKUP in the middle of another backup in the same session. Multiple non-exclusive backups are able to be run conrrently in different sessions. But, in the same session, only one non-exclusive backup can be run at the same moment. If pg_backup_start (pg_start_backup in v14 or before)

pgsql: Prevent BASE_BACKUP in the middle of another backup in the same

2022-07-19 Thread Fujii Masao
Prevent BASE_BACKUP in the middle of another backup in the same session. Multiple non-exclusive backups are able to be run conrrently in different sessions. But, in the same session, only one non-exclusive backup can be run at the same moment. If pg_backup_start (pg_start_backup in v14 or before)

pgsql: Fix assertion failure and segmentation fault in backup code.

2022-07-19 Thread Fujii Masao
Fix assertion failure and segmentation fault in backup code. When a non-exclusive backup is canceled, do_pg_abort_backup() is called and resets some variables set by pg_backup_start (pg_start_backup in v14 or before). But previously it forgot to reset the session state indicating whether a non-exc

pgsql: Prevent BASE_BACKUP in the middle of another backup in the same

2022-07-19 Thread Fujii Masao
Prevent BASE_BACKUP in the middle of another backup in the same session. Multiple non-exclusive backups are able to be run conrrently in different sessions. But, in the same session, only one non-exclusive backup can be run at the same moment. If pg_backup_start (pg_start_backup in v14 or before)

pgsql: Fix assertion failure and segmentation fault in backup code.

2022-07-19 Thread Fujii Masao
Fix assertion failure and segmentation fault in backup code. When a non-exclusive backup is canceled, do_pg_abort_backup() is called and resets some variables set by pg_backup_start (pg_start_backup in v14 or before). But previously it forgot to reset the session state indicating whether a non-exc

pgsql: Prevent BASE_BACKUP in the middle of another backup in the same

2022-07-19 Thread Fujii Masao
Prevent BASE_BACKUP in the middle of another backup in the same session. Multiple non-exclusive backups are able to be run conrrently in different sessions. But, in the same session, only one non-exclusive backup can be run at the same moment. If pg_backup_start (pg_start_backup in v14 or before)

pgsql: Fix assertion failure and segmentation fault in backup code.

2022-07-19 Thread Fujii Masao
Fix assertion failure and segmentation fault in backup code. When a non-exclusive backup is canceled, do_pg_abort_backup() is called and resets some variables set by pg_backup_start (pg_start_backup in v14 or before). But previously it forgot to reset the session state indicating whether a non-exc

pgsql: Prevent BASE_BACKUP in the middle of another backup in the same

2022-07-19 Thread Fujii Masao
Prevent BASE_BACKUP in the middle of another backup in the same session. Multiple non-exclusive backups are able to be run conrrently in different sessions. But, in the same session, only one non-exclusive backup can be run at the same moment. If pg_backup_start (pg_start_backup in v14 or before)

pgsql: Fix assertion failure and segmentation fault in backup code.

2022-07-19 Thread Fujii Masao
Fix assertion failure and segmentation fault in backup code. When a non-exclusive backup is canceled, do_pg_abort_backup() is called and resets some variables set by pg_backup_start (pg_start_backup in v14 or before). But previously it forgot to reset the session state indicating whether a non-exc

pgsql: Tweak detail and hint messages to be consistent with project pol

2022-07-19 Thread Michael Paquier
Tweak detail and hint messages to be consistent with project policy Detail and hint messages should be full sentences and should end with a period, but some of the messages newly-introduced in v15 did not follow that. Author: Justin Pryzby Reviewed-by: Álvaro Herrera Discussion: https://postgr.es

pgsql: Tweak detail and hint messages to be consistent with project pol

2022-07-19 Thread Michael Paquier
Tweak detail and hint messages to be consistent with project policy Detail and hint messages should be full sentences and should end with a period, but some of the messages newly-introduced in v15 did not follow that. Author: Justin Pryzby Reviewed-by: Álvaro Herrera Discussion: https://postgr.es

pgsql: Add regression test for TRUNCATE on foreign table not supporting

2022-07-19 Thread Fujii Masao
Add regression test for TRUNCATE on foreign table not supporting TRUNCATE. file_fdw doesn't support INSERT, UPDATE, DELETE and TRUNCATE. It has the regression test that confirms that INSERT, UPDATE and DELETE fail on its foreign table, but not TRUNCATE yet. It's better to also test TRUNCATE fails

pgsql: Fix missed corner cases for grantable permissions on GUCs.

2022-07-19 Thread Tom Lane
Fix missed corner cases for grantable permissions on GUCs. We allow users to set the values of not-yet-loaded extension GUCs, remembering those values in "placeholder" GUC entries. When/if the extension is loaded later in the session, we need to verify that the user had permissions to set the GUC

pgsql: Fix missed corner cases for grantable permissions on GUCs.

2022-07-19 Thread Tom Lane
Fix missed corner cases for grantable permissions on GUCs. We allow users to set the values of not-yet-loaded extension GUCs, remembering those values in "placeholder" GUC entries. When/if the extension is loaded later in the session, we need to verify that the user had permissions to set the GUC

pgsql: relnotes: clarify pg_basebackup compression options

2022-07-19 Thread Bruce Momjian
relnotes: clarify pg_basebackup compression options Also, a few wording improvements Reported-by: Justin Pryzby Discussion: https://postgr.es/m/[email protected] Backpatch-through: 15 only Branch -- REL_15_STABLE Details --- https://git.postgresql.org/pg/commitdiff

pgsql: relnotes: improve wording of several PG 15 items

2022-07-19 Thread Bruce Momjian
relnotes: improve wording of several PG 15 items Reported-by: Justin Pryzby Discussion: https://postgr.es/m/[email protected] Backpatch-through: 15 only Branch -- REL_15_STABLE Details --- https://git.postgresql.org/pg/commitdiff/15ff26d559537989e17b8bd23c99ae7ca75f

pgsql: Convert planner's AggInfo and AggTransInfo structs to proper Nod

2022-07-19 Thread Tom Lane
Convert planner's AggInfo and AggTransInfo structs to proper Nodes. This is mostly just to get outfuncs.c support for them, so that the agginfos and aggtransinfos lists can be dumped when dumping the contents of PlannerInfo. While here, improve some related comments; notably, clean up obsolete co

pgsql: Estimate cost of elided SubqueryScan, Append, MergeAppend nodes

2022-07-19 Thread Tom Lane
Estimate cost of elided SubqueryScan, Append, MergeAppend nodes better. setrefs.c contains logic to discard no-op SubqueryScan nodes, that is, ones that have no qual to check and copy the input targetlist unchanged. (Formally it's not very nice to be applying such optimizations so late in the plan

Re: pgsql: Default to hidden visibility for extension libraries where possi

2022-07-19 Thread Tom Lane
Alvaro Herrera writes: > On 2022-Jul-19, Pavel Stehule wrote: >> Unfortunately, this commit definitely breaks plpgsql_check. Can the >> following routines be visible? > Do you just need to send a patch to add an exports.txt file to > src/pl/plpgsql/src/ for these functions? The precedent of plpy

Re: pgsql: Default to hidden visibility for extension libraries where possi

2022-07-19 Thread Alvaro Herrera
On 2022-Jul-19, Pavel Stehule wrote: > po 18. 7. 2022 v 3:06 odesílatel Andres Freund napsal: > > > Default to hidden visibility for extension libraries where possible > Unfortunately, this commit definitely breaks plpgsql_check. Can the > following routines be visible? Do you just need to sen

pgsql: Wrap overly long lines

2022-07-19 Thread Alvaro Herrera
Wrap overly long lines Reported by Richard Guo. Reviewed-by: Richard Guo Reviewed-by: Tom Lane Discussion: https://postgr.es/m/cambws4-3ywl_tphjkk-vvzr-tbar--b6xxggm8xe7vsg38a...@mail.gmail.com Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/1679d57a550530ebef62