Re: pgsql: doc: Further clarify how recovery target parameters are applied

2019-11-06 Thread Fujii Masao
On Wed, Nov 6, 2019 at 4:29 PM Peter Eisentraut wrote: > > On 2019-11-06 05:48, Fujii Masao wrote: > > Patch attached. As I argued upthread, IMO it's better to remove > > the latter description from the doc and the patch does that. > > Also the patch adds "mainly" into the former description. > >

pgsql: Fix memory allocation mistake

2019-11-06 Thread Peter Eisentraut
Fix memory allocation mistake The previous code was allocating more memory than necessary because the formula used the wrong data type. Reported-by: Jehan-Guillaume de Rorthais Discussion: https://www.postgresql.org/message-id/20191105172918.3e32a446@firost Branch -- master Details ---

pgsql: Fix memory allocation mistake

2019-11-06 Thread Peter Eisentraut
Fix memory allocation mistake The previous code was allocating more memory than necessary because the formula used the wrong data type. Reported-by: Jehan-Guillaume de Rorthais Discussion: https://www.postgresql.org/message-id/20191105172918.3e32a446@firost Branch -- REL_11_STABLE Details

pgsql: Fix memory allocation mistake

2019-11-06 Thread Peter Eisentraut
Fix memory allocation mistake The previous code was allocating more memory than necessary because the formula used the wrong data type. Reported-by: Jehan-Guillaume de Rorthais Discussion: https://www.postgresql.org/message-id/20191105172918.3e32a446@firost Branch -- REL_10_STABLE Details

pgsql: Fix memory allocation mistake

2019-11-06 Thread Peter Eisentraut
Fix memory allocation mistake The previous code was allocating more memory than necessary because the formula used the wrong data type. Reported-by: Jehan-Guillaume de Rorthais Discussion: https://www.postgresql.org/message-id/20191105172918.3e32a446@firost Branch -- REL_12_STABLE Details

pgsql: Sync our DTrace infrastructure with c.h's definition of type boo

2019-11-06 Thread Tom Lane
Sync our DTrace infrastructure with c.h's definition of type bool. Since commit d26a810eb, we've defined bool as being either _Bool from , or "unsigned char"; but that commit overlooked the fact that probes.d has "#define bool char". For consistency, make it say "unsigned char" instead. This sho

pgsql: Sync our DTrace infrastructure with c.h's definition of type boo

2019-11-06 Thread Tom Lane
Sync our DTrace infrastructure with c.h's definition of type bool. Since commit d26a810eb, we've defined bool as being either _Bool from , or "unsigned char"; but that commit overlooked the fact that probes.d has "#define bool char". For consistency, make it say "unsigned char" instead. This sho

pgsql: Minor code review for tuple slot rewrite.

2019-11-06 Thread Tom Lane
Minor code review for tuple slot rewrite. Avoid creating transiently-inconsistent slot states where possible, by not setting TTS_FLAG_SHOULDFREE until after the slot actually has a free'able tuple pointer, and by making sure that we reset tts_nvalid and related derived state before we replace the

pgsql: Minor code review for tuple slot rewrite.

2019-11-06 Thread Tom Lane
Minor code review for tuple slot rewrite. Avoid creating transiently-inconsistent slot states where possible, by not setting TTS_FLAG_SHOULDFREE until after the slot actually has a free'able tuple pointer, and by making sure that we reset tts_nvalid and related derived state before we replace the

pgsql: Allow sampling of statements depending on duration

2019-11-06 Thread Tomas Vondra
Allow sampling of statements depending on duration This allows logging a sample of statements, without incurring excessive log traffic (which may impact performance). This can be useful when analyzing workloads with lots of short queries. The sampling is configured using two new GUC parameters:

pgsql: Document log_transaction_sample_rate as superuser-only

2019-11-06 Thread Tomas Vondra
Document log_transaction_sample_rate as superuser-only The docs do say which GUCs can be changed only by superusers, but we forgot to mention this for the new log_transaction_sample_rate. This GUC was introduced in PostgreSQL 12, so backpatch accordingly. Author: Adrien Nayrat Backpatch-through:

pgsql: Document log_transaction_sample_rate as superuser-only

2019-11-06 Thread Tomas Vondra
Document log_transaction_sample_rate as superuser-only The docs do say which GUCs can be changed only by superusers, but we forgot to mention this for the new log_transaction_sample_rate. This GUC was introduced in PostgreSQL 12, so backpatch accordingly. Author: Adrien Nayrat Backpatch-through:

pgsql: Check after errors of SPI_execute() in xml.c

2019-11-06 Thread Michael Paquier
Check after errors of SPI_execute() in xml.c SPI gets used to build a list of relation OIDs for XML object generation, and one code path building a list uses SPI_execute() without looking at errors it produces. So fix that. Author: Mark Dilger Reviewed-by: Michael Paquier, Pavel Stehule Discussi

pgsql: Add reusable routine for making arrays unique.

2019-11-06 Thread Thomas Munro
Add reusable routine for making arrays unique. Introduce qunique() and qunique_arg(), which can be used after qsort() and qsort_arg() respectively to remove duplicate values. Use it where appropriate. Author: Thomas Munro Reviewed-by: Tom Lane (in an earlier version) Discussion: https://postgr.

pgsql: Fix assertion failure when running pgbench -s.

2019-11-06 Thread Fujii Masao
Fix assertion failure when running pgbench -s. If there is the WAL page that the continuation WAL record just fits within (i.e., the continuation record ends just at the end of the page) and the LSN in such page is specified with -s option, previously pg_waldump caused an assertion failure. The ca

pgsql: Fix assertion failure when running pgbench -s.

2019-11-06 Thread Fujii Masao
Fix assertion failure when running pgbench -s. If there is the WAL page that the continuation WAL record just fits within (i.e., the continuation record ends just at the end of the page) and the LSN in such page is specified with -s option, previously pg_waldump caused an assertion failure. The ca

pgsql: Fix assertion failure when running pgbench -s.

2019-11-06 Thread Fujii Masao
Fix assertion failure when running pgbench -s. If there is the WAL page that the continuation WAL record just fits within (i.e., the continuation record ends just at the end of the page) and the LSN in such page is specified with -s option, previously pg_waldump caused an assertion failure. The ca

pgsql: Fix assertion failure when running pgbench -s.

2019-11-06 Thread Fujii Masao
Fix assertion failure when running pgbench -s. If there is the WAL page that the continuation WAL record just fits within (i.e., the continuation record ends just at the end of the page) and the LSN in such page is specified with -s option, previously pg_waldump caused an assertion failure. The ca

pgsql: Fix assertion failure when running pgbench -s.

2019-11-06 Thread Fujii Masao
Fix assertion failure when running pgbench -s. If there is the WAL page that the continuation WAL record just fits within (i.e., the continuation record ends just at the end of the page) and the LSN in such page is specified with -s option, previously pg_waldump caused an assertion failure. The ca

pgsql: Fix assertion failure when running pgbench -s.

2019-11-06 Thread Fujii Masao
Fix assertion failure when running pgbench -s. If there is the WAL page that the continuation WAL record just fits within (i.e., the continuation record ends just at the end of the page) and the LSN in such page is specified with -s option, previously pg_waldump caused an assertion failure. The ca

pgsql: Fix assertion failure when running pgbench -s.

2019-11-06 Thread Fujii Masao
Fix assertion failure when running pgbench -s. If there is the WAL page that the continuation WAL record just fits within (i.e., the continuation record ends just at the end of the page) and the LSN in such page is specified with -s option, previously pg_waldump caused an assertion failure. The ca