pgsql: pgstat: set timestamps of fixed-numbered stats after a crash.

2022-04-14 Thread Andres Freund
pgstat: set timestamps of fixed-numbered stats after a crash. When not loading stats at startup (i.e. pgstat_discard_stats() getting called), reset timestamps of fixed numbered stats would be left at 0. Oversight in 5891c7a8ed8. Instead use pgstat_reset_after_failure() and add tests verifying tha

pgsql: Have CLUSTER ignore partitions not owned by caller

2022-04-14 Thread Alvaro Herrera
Have CLUSTER ignore partitions not owned by caller If a partitioned table has partitions owned by roles other than the owner of the partitioned table, don't include them in the to-be- clustered list. This is similar to what VACUUM FULL does (except we do it sooner, because there is no reason to p

pgsql: Reword text on ROW SHARE lock as acquired by SELECT FOR

2022-04-14 Thread Alvaro Herrera
Reword text on ROW SHARE lock as acquired by SELECT FOR It was missing lock levels FOR KEY SHARE and FOR NO KEY EXCLUSIVE; but also SELECT FOR UPDATE is not a command separate from SELECT, as the original text implied. It is clearer to state that FOR is an option of regular SELECT. Per suggest

pgsql: Temporarily add some probes of tenk1's relallvisible in create_i

2022-04-14 Thread Tom Lane
Temporarily add some probes of tenk1's relallvisible in create_index.sql. This is to gather some more evidence about why buildfarm member wrasse is failing. We should revert it (or at least scale it way back) once that's resolved. Discussion: https://postgr.es/m/[email protected]

pgsql: Rethink the delay-checkpoint-end mechanism in the back-branches.

2022-04-14 Thread Robert Haas
Rethink the delay-checkpoint-end mechanism in the back-branches. The back-patch of commit bbace5697df12398e87ffd9879171c39d27f5b33 had the unfortunate effect of changing the layout of PGPROC in the back-branches, which could break extensions. This happened because it changed the delayChkpt from ty

pgsql: Rethink the delay-checkpoint-end mechanism in the back-branches.

2022-04-14 Thread Robert Haas
Rethink the delay-checkpoint-end mechanism in the back-branches. The back-patch of commit bbace5697df12398e87ffd9879171c39d27f5b33 had the unfortunate effect of changing the layout of PGPROC in the back-branches, which could break extensions. This happened because it changed the delayChkpt from ty

pgsql: Rethink the delay-checkpoint-end mechanism in the back-branches.

2022-04-14 Thread Robert Haas
Rethink the delay-checkpoint-end mechanism in the back-branches. The back-patch of commit bbace5697df12398e87ffd9879171c39d27f5b33 had the unfortunate effect of changing the layout of PGPROC in the back-branches, which could break extensions. This happened because it changed the delayChkpt from ty

pgsql: Rethink the delay-checkpoint-end mechanism in the back-branches.

2022-04-14 Thread Robert Haas
Rethink the delay-checkpoint-end mechanism in the back-branches. The back-patch of commit bbace5697df12398e87ffd9879171c39d27f5b33 had the unfortunate effect of changing the layout of PGPROC in the back-branches, which could break extensions. This happened because it changed the delayChkpt from ty

pgsql: Rethink the delay-checkpoint-end mechanism in the back-branches.

2022-04-14 Thread Robert Haas
Rethink the delay-checkpoint-end mechanism in the back-branches. The back-patch of commit bbace5697df12398e87ffd9879171c39d27f5b33 had the unfortunate effect of changing the layout of PGPROC in the back-branches, which could break extensions. This happened because it changed the delayChkpt from ty

pgsql: Improve a couple of sql/json error messages

2022-04-14 Thread Andrew Dunstan
Improve a couple of sql/json error messages Fix the grammar in two, and add a hint to one. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/4cd8717af3f0345c758d46fea06fb390b4d593f2 Modified Files -- src/backend/parser/parse_expr.c| 5 +++-- s

pgsql: Fix transformJsonBehavior

2022-04-14 Thread Andrew Dunstan
Fix transformJsonBehavior Commit 1a36bc9dba8 conained some logic that was a little opaque and could have involved a NULL dereference, as complained about by Coverity. Make the logic more transparent and in doing so avoid the NULL dereference. Branch -- master Details --- https://git.post