pgsql: Plug memory leak in index_get_partition

2020-11-06 Thread Alvaro Herrera
Plug memory leak in index_get_partition The list of indexes was being leaked when asked for an index that doesn't have an index partition in the table partition. Not a common case admittedly --and in most cases where it occurs, caller throws an error anyway-- but worth fixing for cleanliness and

pgsql: Plug memory leak in index_get_partition

2020-11-06 Thread Alvaro Herrera
Plug memory leak in index_get_partition The list of indexes was being leaked when asked for an index that doesn't have an index partition in the table partition. Not a common case admittedly --and in most cases where it occurs, caller throws an error anyway-- but worth fixing for cleanliness and

pgsql: Plug memory leak in index_get_partition

2020-11-06 Thread Alvaro Herrera
Plug memory leak in index_get_partition The list of indexes was being leaked when asked for an index that doesn't have an index partition in the table partition. Not a common case admittedly --and in most cases where it occurs, caller throws an error anyway-- but worth fixing for cleanliness and

pgsql: Add GUC_LIST_INPUT and GUC_LIST_QUOTE to unix_socket_directories

2020-11-06 Thread Michael Paquier
Add GUC_LIST_INPUT and GUC_LIST_QUOTE to unix_socket_directories This should have been done in the initial commit that made unix_socket_directories a list as of c9b0cbe. This change allows to support correctly the case of ALTER SYSTEM, where it is possible to specify multiple paths as a list, lik

Re: pgsql: Use the non-deprecated TG_TABLE_MAME in test trigger

2020-11-06 Thread Michael Paquier
Hi Magnus, On Tue, Nov 03, 2020 at 09:22:40AM +, Magnus Hagander wrote: > Use the non-deprecated TG_TABLE_MAME in test trigger > > Commit 3a9ae3d2068 (back in 2006) deprecated TG_RELNAME > in favor of TG_TABLE_NAME, but the existing usage in test > cases has remained till today. Change to use

pgsql: Fix minor issues with new unicode {de,re}composition code

2020-11-06 Thread Michael Paquier
Fix minor issues with new unicode {de,re}composition code The table generation script would incorrectly complain in the recomposition sorting when matching code points. This would not have caused the generation of an incorrect table. Note that this condition is not reachable yet, but could have

pgsql: Properly detoast data in brin_form_tuple

2020-11-06 Thread Tomas Vondra
Properly detoast data in brin_form_tuple brin_form_tuple failed to consider the values may be toasted, inserting the toast pointer into the index. This may easily result in index corruption, as the toast data may be deleted and cleaned up by vacuum. The cleanup however does not care about indexes,

pgsql: Properly detoast data in brin_form_tuple

2020-11-06 Thread Tomas Vondra
Properly detoast data in brin_form_tuple brin_form_tuple failed to consider the values may be toasted, inserting the toast pointer into the index. This may easily result in index corruption, as the toast data may be deleted and cleaned up by vacuum. The cleanup however does not care about indexes,

pgsql: Properly detoast data in brin_form_tuple

2020-11-06 Thread Tomas Vondra
Properly detoast data in brin_form_tuple brin_form_tuple failed to consider the values may be toasted, inserting the toast pointer into the index. This may easily result in index corruption, as the toast data may be deleted and cleaned up by vacuum. The cleanup however does not care about indexes,

pgsql: Properly detoast data in brin_form_tuple

2020-11-06 Thread Tomas Vondra
Properly detoast data in brin_form_tuple brin_form_tuple failed to consider the values may be toasted, inserting the toast pointer into the index. This may easily result in index corruption, as the toast data may be deleted and cleaned up by vacuum. The cleanup however does not care about indexes,

pgsql: Properly detoast data in brin_form_tuple

2020-11-06 Thread Tomas Vondra
Properly detoast data in brin_form_tuple brin_form_tuple failed to consider the values may be toasted, inserting the toast pointer into the index. This may easily result in index corruption, as the toast data may be deleted and cleaned up by vacuum. The cleanup however does not care about indexes,

pgsql: Properly detoast data in brin_form_tuple

2020-11-06 Thread Tomas Vondra
Properly detoast data in brin_form_tuple brin_form_tuple failed to consider the values may be toasted, inserting the toast pointer into the index. This may easily result in index corruption, as the toast data may be deleted and cleaned up by vacuum. The cleanup however does not care about indexes,

pgsql: Properly detoast data in brin_form_tuple

2020-11-06 Thread Tomas Vondra
Properly detoast data in brin_form_tuple brin_form_tuple failed to consider the values may be toasted, inserting the toast pointer into the index. This may easily result in index corruption, as the toast data may be deleted and cleaned up by vacuum. The cleanup however does not care about indexes,

pgsql: First-draft release notes for 13.1.

2020-11-06 Thread Tom Lane
First-draft release notes for 13.1. As usual, the release notes for other branches will be made by cutting these down, but put them up for community review first. Also as usual for a .1 release, there are some entries here that are not really relevant for v13 because they already appeared in 13.0

pgsql: Revert "Accept relations of any kind in LOCK TABLE".

2020-11-06 Thread Tom Lane
Revert "Accept relations of any kind in LOCK TABLE". Revert 59ab4ac32, as well as the followup fix 33862cb9c, in all branches. We need to think a bit harder about what the behavior of LOCK TABLE on views should be, and there's no time for that before next week's releases. We'll take another crac

pgsql: Revert "pg_dump: Lock all relations, not just plain tables".

2020-11-06 Thread Tom Lane
Revert "pg_dump: Lock all relations, not just plain tables". Revert 403a3d91c, as well as the followup fix 7f4235032, in all branches. We need to think a bit harder about what the behavior of LOCK TABLE on views should be, and there's no time for that before next week's releases. We'll take anot

pgsql: Revert "pg_dump: Lock all relations, not just plain tables".

2020-11-06 Thread Tom Lane
Revert "pg_dump: Lock all relations, not just plain tables". Revert 403a3d91c, as well as the followup fix 7f4235032, in all branches. We need to think a bit harder about what the behavior of LOCK TABLE on views should be, and there's no time for that before next week's releases. We'll take anot

pgsql: Revert "pg_dump: Lock all relations, not just plain tables".

2020-11-06 Thread Tom Lane
Revert "pg_dump: Lock all relations, not just plain tables". Revert 403a3d91c, as well as the followup fix 7f4235032, in all branches. We need to think a bit harder about what the behavior of LOCK TABLE on views should be, and there's no time for that before next week's releases. We'll take anot

pgsql: Revert "Accept relations of any kind in LOCK TABLE".

2020-11-06 Thread Tom Lane
Revert "Accept relations of any kind in LOCK TABLE". Revert 59ab4ac32, as well as the followup fix 33862cb9c, in all branches. We need to think a bit harder about what the behavior of LOCK TABLE on views should be, and there's no time for that before next week's releases. We'll take another crac

pgsql: Revert "Accept relations of any kind in LOCK TABLE".

2020-11-06 Thread Tom Lane
Revert "Accept relations of any kind in LOCK TABLE". Revert 59ab4ac32, as well as the followup fix 33862cb9c, in all branches. We need to think a bit harder about what the behavior of LOCK TABLE on views should be, and there's no time for that before next week's releases. We'll take another crac

pgsql: Revert "Accept relations of any kind in LOCK TABLE".

2020-11-06 Thread Tom Lane
Revert "Accept relations of any kind in LOCK TABLE". Revert 59ab4ac32, as well as the followup fix 33862cb9c, in all branches. We need to think a bit harder about what the behavior of LOCK TABLE on views should be, and there's no time for that before next week's releases. We'll take another crac

pgsql: Revert "pg_dump: Lock all relations, not just plain tables".

2020-11-06 Thread Tom Lane
Revert "pg_dump: Lock all relations, not just plain tables". Revert 403a3d91c, as well as the followup fix 7f4235032, in all branches. We need to think a bit harder about what the behavior of LOCK TABLE on views should be, and there's no time for that before next week's releases. We'll take anot

pgsql: Revert "Accept relations of any kind in LOCK TABLE".

2020-11-06 Thread Tom Lane
Revert "Accept relations of any kind in LOCK TABLE". Revert 59ab4ac32, as well as the followup fix 33862cb9c, in all branches. We need to think a bit harder about what the behavior of LOCK TABLE on views should be, and there's no time for that before next week's releases. We'll take another crac

pgsql: Revert "pg_dump: Lock all relations, not just plain tables".

2020-11-06 Thread Tom Lane
Revert "pg_dump: Lock all relations, not just plain tables". Revert 403a3d91c, as well as the followup fix 7f4235032, in all branches. We need to think a bit harder about what the behavior of LOCK TABLE on views should be, and there's no time for that before next week's releases. We'll take anot

pgsql: Revert "Accept relations of any kind in LOCK TABLE".

2020-11-06 Thread Tom Lane
Revert "Accept relations of any kind in LOCK TABLE". Revert 59ab4ac32, as well as the followup fix 33862cb9c, in all branches. We need to think a bit harder about what the behavior of LOCK TABLE on views should be, and there's no time for that before next week's releases. We'll take another crac

pgsql: Revert "Accept relations of any kind in LOCK TABLE".

2020-11-06 Thread Tom Lane
Revert "Accept relations of any kind in LOCK TABLE". Revert 59ab4ac32, as well as the followup fix 33862cb9c, in all branches. We need to think a bit harder about what the behavior of LOCK TABLE on views should be, and there's no time for that before next week's releases. We'll take another crac

pgsql: Revert "pg_dump: Lock all relations, not just plain tables".

2020-11-06 Thread Tom Lane
Revert "pg_dump: Lock all relations, not just plain tables". Revert 403a3d91c, as well as the followup fix 7f4235032, in all branches. We need to think a bit harder about what the behavior of LOCK TABLE on views should be, and there's no time for that before next week's releases. We'll take anot

pgsql: Revert "pg_dump: Lock all relations, not just plain tables".

2020-11-06 Thread Tom Lane
Revert "pg_dump: Lock all relations, not just plain tables". Revert 403a3d91c, as well as the followup fix 7f4235032, in all branches. We need to think a bit harder about what the behavior of LOCK TABLE on views should be, and there's no time for that before next week's releases. We'll take anot

pgsql: Doc: undo mistaken adjustment to LOCK TABLE docs in back branche

2020-11-06 Thread Tom Lane
Doc: undo mistaken adjustment to LOCK TABLE docs in back branches. Commits 59ab4ac32 et al mistakenly copied-and-pasted some text about how LOCK on a view recurses to referenced tables into pre-v11 branches, which in fact don't do that. Undo that, and instead state clearly that they don't. (I al

pgsql: Doc: undo mistaken adjustment to LOCK TABLE docs in back branche

2020-11-06 Thread Tom Lane
Doc: undo mistaken adjustment to LOCK TABLE docs in back branches. Commits 59ab4ac32 et al mistakenly copied-and-pasted some text about how LOCK on a view recurses to referenced tables into pre-v11 branches, which in fact don't do that. Undo that, and instead state clearly that they don't. (I al

pgsql: Doc: undo mistaken adjustment to LOCK TABLE docs in back branche

2020-11-06 Thread Tom Lane
Doc: undo mistaken adjustment to LOCK TABLE docs in back branches. Commits 59ab4ac32 et al mistakenly copied-and-pasted some text about how LOCK on a view recurses to referenced tables into pre-v11 branches, which in fact don't do that. Undo that, and instead state clearly that they don't. (I al

pgsql: pg_prewarm: make autoprewarm leader use standard SIGHUP and SIGT

2020-11-06 Thread Fujii Masao
pg_prewarm: make autoprewarm leader use standard SIGHUP and SIGTERM handlers. Commit 1e53fe0e70 changed background processes so that they use standard SIGHUP handler. Like that, this commit makes autoprewarm leader process also use standard SIGHUP and SIGTERM handlers, to simplify the code. Autho

pgsql: Add pg_strong_random_init function to initialize random number g

2020-11-06 Thread Magnus Hagander
Add pg_strong_random_init function to initialize random number generator Currently only OpenSSL requires this initialization, but in the future other SSL implementations are likely to need it as well. Abstracting this functionality out into a separate function makes this cleaner and more clear, an