pgsql: doc: Add note about the server name of postgres_fdw_get_connecti

2021-01-18 Thread Fujii Masao
doc: Add note about the server name of postgres_fdw_get_connections() returns. Previously the document didn't mention the case where postgres_fdw_get_connections() returns NULL in server_name column. Users might be confused about why NULL was returned. This commit adds the note that, in postgres_

pgsql: pgindent worker.c.

2021-01-18 Thread Amit Kapila
pgindent worker.c. This is a leftover from commit 0926e96c49. Changing this separately because this file is being modified for upcoming patch logical replication of 2PC. Author: Peter Smith Discussion: https://postgr.es/m/cahut+ps+egg8kzcmayagbui_vutps6o9za8dg6sdno0-yuo...@mail.gmail.com Branch

pgsql: doc: adjust alignment of doc file list for "pg_waldump.sgml"

2021-01-18 Thread Bruce Momjian
doc: adjust alignment of doc file list for "pg_waldump.sgml" Backpatch-through: 10 Branch -- REL_11_STABLE Details --- https://git.postgresql.org/pg/commitdiff/777bf92e33515bb6be2f73b6df4096496385bf55 Modified Files -- doc/src/sgml/ref/allfiles.sgml | 2 +- 1 file changed, 1

pgsql: doc: adjust alignment of doc file list for "pg_waldump.sgml"

2021-01-18 Thread Bruce Momjian
doc: adjust alignment of doc file list for "pg_waldump.sgml" Backpatch-through: 10 Branch -- REL_12_STABLE Details --- https://git.postgresql.org/pg/commitdiff/6b7436202604fc6be923c464123f3398b9c07485 Modified Files -- doc/src/sgml/ref/allfiles.sgml | 2 +- 1 file changed, 1

pgsql: doc: adjust alignment of doc file list for "pg_waldump.sgml"

2021-01-18 Thread Bruce Momjian
doc: adjust alignment of doc file list for "pg_waldump.sgml" Backpatch-through: 10 Branch -- REL_13_STABLE Details --- https://git.postgresql.org/pg/commitdiff/6c183aff1817d86397aa9c54cd06c286e1876bc7 Modified Files -- doc/src/sgml/ref/allfiles.sgml | 2 +- 1 file changed, 1

pgsql: doc: adjust alignment of doc file list for "pg_waldump.sgml"

2021-01-18 Thread Bruce Momjian
doc: adjust alignment of doc file list for "pg_waldump.sgml" Backpatch-through: 10 Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/9e7dbe3369cd8f5b0136c53b817471002505f934 Modified Files -- doc/src/sgml/ref/allfiles.sgml | 2 +- 1 file changed, 1 insert

pgsql: doc: adjust alignment of doc file list for "pg_waldump.sgml"

2021-01-18 Thread Bruce Momjian
doc: adjust alignment of doc file list for "pg_waldump.sgml" Backpatch-through: 10 Branch -- REL_10_STABLE Details --- https://git.postgresql.org/pg/commitdiff/0efe2a0580e9a0790693a2a94e586317b445b1c8 Modified Files -- doc/src/sgml/ref/allfiles.sgml | 2 +- 1 file changed, 1

pgsql: Avoid crash with WHERE CURRENT OF and a custom scan plan.

2021-01-18 Thread Tom Lane
Avoid crash with WHERE CURRENT OF and a custom scan plan. execCurrent.c's search_plan_tree() assumed that ForeignScanStates and CustomScanStates necessarily have a valid ss_currentRelation. This is demonstrably untrue for postgres_fdw's remote join and remote aggregation plans, and non-leaf custom

pgsql: Avoid crash with WHERE CURRENT OF and a custom scan plan.

2021-01-18 Thread Tom Lane
Avoid crash with WHERE CURRENT OF and a custom scan plan. execCurrent.c's search_plan_tree() assumed that ForeignScanStates and CustomScanStates necessarily have a valid ss_currentRelation. This is demonstrably untrue for postgres_fdw's remote join and remote aggregation plans, and non-leaf custom

pgsql: Avoid crash with WHERE CURRENT OF and a custom scan plan.

2021-01-18 Thread Tom Lane
Avoid crash with WHERE CURRENT OF and a custom scan plan. execCurrent.c's search_plan_tree() assumed that ForeignScanStates and CustomScanStates necessarily have a valid ss_currentRelation. This is demonstrably untrue for postgres_fdw's remote join and remote aggregation plans, and non-leaf custom

pgsql: Avoid crash with WHERE CURRENT OF and a custom scan plan.

2021-01-18 Thread Tom Lane
Avoid crash with WHERE CURRENT OF and a custom scan plan. execCurrent.c's search_plan_tree() assumed that ForeignScanStates and CustomScanStates necessarily have a valid ss_currentRelation. This is demonstrably untrue for postgres_fdw's remote join and remote aggregation plans, and non-leaf custom

pgsql: Avoid crash with WHERE CURRENT OF and a custom scan plan.

2021-01-18 Thread Tom Lane
Avoid crash with WHERE CURRENT OF and a custom scan plan. execCurrent.c's search_plan_tree() assumed that ForeignScanStates and CustomScanStates necessarily have a valid ss_currentRelation. This is demonstrably untrue for postgres_fdw's remote join and remote aggregation plans, and non-leaf custom

pgsql: Avoid crash with WHERE CURRENT OF and a custom scan plan.

2021-01-18 Thread Tom Lane
Avoid crash with WHERE CURRENT OF and a custom scan plan. execCurrent.c's search_plan_tree() assumed that ForeignScanStates and CustomScanStates necessarily have a valid ss_currentRelation. This is demonstrably untrue for postgres_fdw's remote join and remote aggregation plans, and non-leaf custom

pgsql: Avoid crash with WHERE CURRENT OF and a custom scan plan.

2021-01-18 Thread Tom Lane
Avoid crash with WHERE CURRENT OF and a custom scan plan. execCurrent.c's search_plan_tree() assumed that ForeignScanStates and CustomScanStates necessarily have a valid ss_currentRelation. This is demonstrably untrue for postgres_fdw's remote join and remote aggregation plans, and non-leaf custom

pgsql: Narrow the scope of a local variable.

2021-01-18 Thread Tom Lane
Narrow the scope of a local variable. This is better style and more symmetrical with the other if-branch. This likely should have been included in 9de77b545 (which created the opportunity), but it was overlooked. Japin Li Discussion: https://postgr.es/m/meyp282mb16699fa4a7cd57eb250e871fb6...@me

pgsql: Allow for error or refusal while absorbing a ProcSignalBarrier.

2021-01-18 Thread Robert Haas
Allow for error or refusal while absorbing a ProcSignalBarrier. Previously, the per-barrier-type functions tasked with absorbing them were expected to always succeed and never throw an error. However, that's a bit inconvenient. Further study has revealed that there are realistic cases where it mig

pgsql: Add bytea equivalents of ltrim() and rtrim().

2021-01-18 Thread Tom Lane
Add bytea equivalents of ltrim() and rtrim(). We had bytea btrim() already, but for some reason not the other two. Joel Jacobson Discussion: https://postgr.es/m/d10cd5cd-a901-42f1-b832-763ac6f7f...@www.fastmail.com Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/

Re: pgsql: Add pg_stat_database counters for sessions and session time

2021-01-18 Thread Magnus Hagander
On Mon, Jan 18, 2021 at 5:09 PM Laurenz Albe wrote: > > On Sun, 2021-01-17 at 13:07 +, Magnus Hagander wrote: > > Add pg_stat_database counters for sessions and session time > > > > This add counters for number of sessions, the different kind of session > > termination types, and timers for ho

pgsql: Bump PGSTAT_FILE_FORMAT_ID

2021-01-18 Thread Magnus Hagander
Bump PGSTAT_FILE_FORMAT_ID This was missed in 960869da08 Reported-By: Laurenz Albe Discussion: https://postgr.es/m/4f0aacc5fe1b4bfafa32b36ecd97469fae526a75.ca...@cybertec.at Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/b2f87b46690ab8cd3ee7c77226fcf3f5bb713e5b

Re: pgsql: Add pg_stat_database counters for sessions and session time

2021-01-18 Thread Laurenz Albe
On Sun, 2021-01-17 at 13:07 +, Magnus Hagander wrote: > Add pg_stat_database counters for sessions and session time > > This add counters for number of sessions, the different kind of session > termination types, and timers for how much time is spent in active vs > idle in a database to pg_sta

pgsql: Check for BuildIndexValueDescription returning NULL in gist_page

2021-01-18 Thread Heikki Linnakangas
Check for BuildIndexValueDescription returning NULL in gist_page_items Per Coverity. BuildIndexValueDescription() cannot actually return NULL in this instance, because it only returns NULL if the user doesn't have the required privileges, and this function can only be used by superuser. But better

pgsql: Pause recovery for insufficient parameter settings

2021-01-18 Thread Peter Eisentraut
Pause recovery for insufficient parameter settings When certain parameters are changed on a physical replication primary, this is communicated to standbys using the XLOG_PARAMETER_CHANGE WAL record. The standby then checks whether its own settings are at least as big as the ones on the primary.