pgsql: Drop other index behind pg_upgrade test issue.

2021-03-10 Thread Peter Geoghegan
Drop other index behind pg_upgrade test issue. Fix the test failure by dropping the index in question. Missed by commit 57ae7885. Per buildfarm member crake. Backpatch: 11-12 only Branch -- REL_11_STABLE Details --- https://git.postgresql.org/pg/commitdiff/28cf4d93d045b9862ef2d8b49a53

pgsql: Drop other index behind pg_upgrade test issue.

2021-03-10 Thread Peter Geoghegan
Drop other index behind pg_upgrade test issue. Fix the test failure by dropping the index in question. Missed by commit 57ae7885. Per buildfarm member crake. Backpatch: 11-12 only Branch -- REL_12_STABLE Details --- https://git.postgresql.org/pg/commitdiff/1cc33ab95ccea0e1e36651d57ca1

Re: pgsql: Don't consider newly inserted tuples in nbtree VACUUM.

2021-03-10 Thread Peter Geoghegan
On Wed, Mar 10, 2021 at 10:57 PM Michael Paquier wrote: > I think that this commit has some issues that need more thoughts. > > The removal of vacuum_cleanup_index_scale_factor means that any > existing deployment of Postgres that includes at least one index using > this parameter would fail in th

Re: pgsql: Don't consider newly inserted tuples in nbtree VACUUM.

2021-03-10 Thread Michael Paquier
Hi Peter, On Thu, Mar 11, 2021 at 12:27:25AM +, Peter Geoghegan wrote: > The vacuum_cleanup_index_scale_factor/stats interface made the nbtree AM > partially responsible for deciding when pg_class.reltuples stats needed > to be updated. This seems contrary to the spirit of the index AM API, >

pgsql: Doc: B-Tree only has one additional parameter.

2021-03-10 Thread Peter Geoghegan
Doc: B-Tree only has one additional parameter. Oversight in commit 9f3665fb. Backpatch: 13-, just like commit 9f3665fb. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/3f0daeb02f8dd605f89de9aa2349137c09cc7fb4 Modified Files -- doc/src/sgml/ref/create_i

pgsql: Doc: B-Tree only has one additional parameter.

2021-03-10 Thread Peter Geoghegan
Doc: B-Tree only has one additional parameter. Oversight in commit 9f3665fb. Backpatch: 13-, just like commit 9f3665fb. Branch -- REL_13_STABLE Details --- https://git.postgresql.org/pg/commitdiff/635048eb92e819d7a24202d74949e449ac5c7ef3 Modified Files -- doc/src/sgml/ref/c

pgsql: Improve comment for struct BufferDesc.

2021-03-10 Thread Thomas Munro
Improve comment for struct BufferDesc. Add a note that per-buffer I/O condition variables currently live outside the BufferDesc struct. Follow-up for commit d8725104. Reported-by: Julien Rouhaud Discussion: https://postgr.es/m/20210311031118.hucytmrgwlktjxgq%40nol Branch -- master Details

Re: pgsql: Don't consider newly inserted tuples in nbtree VACUUM.

2021-03-10 Thread Peter Geoghegan
On Wed, Mar 10, 2021 at 5:49 PM Peter Geoghegan wrote: > Perhaps the best solution is also the simplest: revert the tests for > vacuum_cleanup_index_scale_factor storage on the backbranches > (Postgres 12 and 13) too. The tests in question don't test much. I just pushed a fix to REL_11_STABLE and

pgsql: Drop index behind pg_upgrade test issue.

2021-03-10 Thread Peter Geoghegan
Drop index behind pg_upgrade test issue. The vacuum_cleanup_index_scale_factor storage parameter was set in a btree index that was previously left behind in the regression test database. As a result, the index gets tested within pg_dump and pg_restore tests, as well as pg_upgrade testing. This w

pgsql: Drop index behind pg_upgrade test issue.

2021-03-10 Thread Peter Geoghegan
Drop index behind pg_upgrade test issue. The vacuum_cleanup_index_scale_factor storage parameter was set in a btree index that was previously left behind in the regression test database. As a result, the index gets tested within pg_dump and pg_restore tests, as well as pg_upgrade testing. This w

Re: pgsql: Don't consider newly inserted tuples in nbtree VACUUM.

2021-03-10 Thread Peter Geoghegan
On Wed, Mar 10, 2021 at 4:27 PM Peter Geoghegan wrote: > Don't consider newly inserted tuples in nbtree VACUUM. > > Remove the entire idea of "stale stats" within nbtree VACUUM (stop > caring about stats involving the number of inserted tuples). Also > remove the vacuum_cleanup_index_scale_factor

pgsql: tutorial: land height is "elevation", not "altitude"

2021-03-10 Thread Bruce Momjian
tutorial: land height is "elevation", not "altitude" This is a follow-on patch to 92c12e46d5. In that patch, we renamed "altitude" to "elevation" in the docs, based on these details: https://mapscaping.com/blogs/geo-candy/what-is-the-difference-between-elevation-relief-and-altitude This re

pgsql: tutorial: land height is "elevation", not "altitude"

2021-03-10 Thread Bruce Momjian
tutorial: land height is "elevation", not "altitude" This is a follow-on patch to 92c12e46d5. In that patch, we renamed "altitude" to "elevation" in the docs, based on these details: https://mapscaping.com/blogs/geo-candy/what-is-the-difference-between-elevation-relief-and-altitude This re

pgsql: tutorial: land height is "elevation", not "altitude"

2021-03-10 Thread Bruce Momjian
tutorial: land height is "elevation", not "altitude" This is a follow-on patch to 92c12e46d5. In that patch, we renamed "altitude" to "elevation" in the docs, based on these details: https://mapscaping.com/blogs/geo-candy/what-is-the-difference-between-elevation-relief-and-altitude This re

pgsql: tutorial: land height is "elevation", not "altitude"

2021-03-10 Thread Bruce Momjian
tutorial: land height is "elevation", not "altitude" This is a follow-on patch to 92c12e46d5. In that patch, we renamed "altitude" to "elevation" in the docs, based on these details: https://mapscaping.com/blogs/geo-candy/what-is-the-difference-between-elevation-relief-and-altitude This re

pgsql: tutorial: land height is "elevation", not "altitude"

2021-03-10 Thread Bruce Momjian
tutorial: land height is "elevation", not "altitude" This is a follow-on patch to 92c12e46d5. In that patch, we renamed "altitude" to "elevation" in the docs, based on these details: https://mapscaping.com/blogs/geo-candy/what-is-the-difference-between-elevation-relief-and-altitude This re

pgsql: tutorial: land height is "elevation", not "altitude"

2021-03-10 Thread Bruce Momjian
tutorial: land height is "elevation", not "altitude" This is a follow-on patch to 92c12e46d5. In that patch, we renamed "altitude" to "elevation" in the docs, based on these details: https://mapscaping.com/blogs/geo-candy/what-is-the-difference-between-elevation-relief-and-altitude This re

pgsql: VACUUM ANALYZE: Always update pg_class.reltuples.

2021-03-10 Thread Peter Geoghegan
VACUUM ANALYZE: Always update pg_class.reltuples. vacuumlazy.c sometimes fails to update pg_class entries for each index (to ensure that pg_class.reltuples is current), even though analyze.c assumed that that must have happened during VACUUM ANALYZE. There are at least a couple of reasons for thi

pgsql: VACUUM ANALYZE: Always update pg_class.reltuples.

2021-03-10 Thread Peter Geoghegan
VACUUM ANALYZE: Always update pg_class.reltuples. vacuumlazy.c sometimes fails to update pg_class entries for each index (to ensure that pg_class.reltuples is current), even though analyze.c assumed that that must have happened during VACUUM ANALYZE. There are at least a couple of reasons for thi

pgsql: Don't consider newly inserted tuples in nbtree VACUUM.

2021-03-10 Thread Peter Geoghegan
Don't consider newly inserted tuples in nbtree VACUUM. Remove the entire idea of "stale stats" within nbtree VACUUM (stop caring about stats involving the number of inserted tuples). Also remove the vacuum_cleanup_index_scale_factor GUC/param on the master branch (though just disable them on post

pgsql: Don't consider newly inserted tuples in nbtree VACUUM.

2021-03-10 Thread Peter Geoghegan
Don't consider newly inserted tuples in nbtree VACUUM. Remove the entire idea of "stale stats" within nbtree VACUUM (stop caring about stats involving the number of inserted tuples). Also remove the vacuum_cleanup_index_scale_factor GUC/param on the master branch (though just disable them on post

pgsql: C comments: improve description of GiST NSN and GistBuildLSN

2021-03-10 Thread Bruce Momjian
C comments: improve description of GiST NSN and GistBuildLSN GiST indexes are complex, so adding more details in the code might help someone. Discussion: https://postgr.es/m/[email protected] Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/845ac7f847

pgsql: Replace buffer I/O locks with condition variables.

2021-03-10 Thread Thomas Munro
Replace buffer I/O locks with condition variables. 1. Backends waiting for buffer I/O are now interruptible. 2. If something goes wrong in a backend that is currently performing I/O, waiting backends no longer wake up until that backend reaches AbortBufferIO() and broadcasts on the CV. Previou

pgsql: Avoid creating duplicate cached plans for inherited FK constrain

2021-03-10 Thread Tom Lane
Avoid creating duplicate cached plans for inherited FK constraints. When a foreign key constraint is applied to a partitioned table, each leaf partition inherits a similar FK constraint. We were processing all of those constraints independently, meaning that in large partitioning trees we'd build

pgsql: Doc: get rid of tags.

2021-03-10 Thread Tom Lane
Doc: get rid of tags. We italicized some, but not all, instances of "per se", "pro forma", and "ad hoc". These phrases are widespread in formal registers of English, so it"s debatable whether they even qualify as foreign. We could instead try to be more consistent in the use of , but that"s diffi

pgsql: Doc: improve introductory information about procedures.

2021-03-10 Thread Tom Lane
Doc: improve introductory information about procedures. Clarify the discussion in "User-Defined Procedures", by laying out the key differences between functions and procedures in a bulleted list. Notably, this avoids burying the lede about procedures being able to do transaction control. Make th

pgsql: Doc: fix missing mention of procedure OUT parameters.

2021-03-10 Thread Tom Lane
Doc: fix missing mention of procedure OUT parameters. Small oversight in commit 2453ea142. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/3ebc6d295705fec37dc8f57a4ece54b370f55f72 Modified Files -- doc/src/sgml/plpgsql.sgml | 3 ++- 1 file changed, 2 ins

pgsql: Doc: improve introductory information about procedures.

2021-03-10 Thread Tom Lane
Doc: improve introductory information about procedures. Clarify the discussion in "User-Defined Procedures", by laying out the key differences between functions and procedures in a bulleted list. Notably, this avoids burying the lede about procedures being able to do transaction control. Make th

pgsql: Doc: improve introductory information about procedures.

2021-03-10 Thread Tom Lane
Doc: improve introductory information about procedures. Clarify the discussion in "User-Defined Procedures", by laying out the key differences between functions and procedures in a bulleted list. Notably, this avoids burying the lede about procedures being able to do transaction control. Make th

pgsql: Doc: improve introductory information about procedures.

2021-03-10 Thread Tom Lane
Doc: improve introductory information about procedures. Clarify the discussion in "User-Defined Procedures", by laying out the key differences between functions and procedures in a bulleted list. Notably, this avoids burying the lede about procedures being able to do transaction control. Make th

pgsql: Add bound check before bsearch() for performance

2021-03-10 Thread Peter Eisentraut
Add bound check before bsearch() for performance In the current lazy vacuum implementation, some index AMs such as btree indexes call lazy_tid_reaped() for each index tuple during ambulkdelete to check if the index tuple points to the (collected) garbage tuple. In that function, we simply call bs

Re: pgsql: pgbench: Refactor thread portability support.

2021-03-10 Thread Thomas Munro
On Wed, Mar 10, 2021 at 9:49 PM Thomas Munro wrote: > On Wed, Mar 10, 2021 at 9:38 PM Thomas Munro wrote: > > On Wed, Mar 10, 2021 at 8:51 PM Thomas Munro wrote: > > >... I'm now contemplating what's up with hoverfly (some AIX header > > > problem)... > > > > Pushed something for the other two

pgsql: Fix another portability bug in recent pgbench commit.

2021-03-10 Thread Thomas Munro
Fix another portability bug in recent pgbench commit. Commit 547f04e7 produced errors on AIX/xlc while building plpython. The new code appears to be incompatible with the hack installed by commit a11cf433. Without access to an AIX system to check, my guess is that _POSIX_C_SOURCE may be required

Re: pgsql: pgbench: Refactor thread portability support.

2021-03-10 Thread Thomas Munro
On Wed, Mar 10, 2021 at 9:38 PM Thomas Munro wrote: > On Wed, Mar 10, 2021 at 8:51 PM Thomas Munro wrote: > >... I'm now contemplating what's up with hoverfly (some AIX header > > problem)... > > Pushed something for the other two failures seen, but for this one I'm > temporarily stumped. We ma

Re: pgsql: pgbench: Refactor thread portability support.

2021-03-10 Thread Thomas Munro
On Wed, Mar 10, 2021 at 8:51 PM Thomas Munro wrote: >... I'm now contemplating what's up with hoverfly (some AIX header > problem)... Pushed something for the other two failures seen, but for this one I'm temporarily stumped. We managed to compile all kinds of stuff that surely includes the mod

pgsql: Try to fix portability bugs in recent pgbench commits.

2021-03-10 Thread Thomas Munro
Try to fix portability bugs in recent pgbench commits. 1. pg_time_usec_t needs to be printed with INT64_FORMAT, not %ld, or 32 bit systems complain, per lapwing. 2. Some Windows compilers didn't like a thread function not marked with __stdcall, per whelk; let's see if this fixes the problem. B

Re: pgsql: Enable parallel SELECT for "INSERT INTO ... SELECT ...".

2021-03-10 Thread Amit Kapila
On Wed, Mar 10, 2021 at 9:07 AM Tom Lane wrote: > > Amit Kapila writes: > > Enable parallel SELECT for "INSERT INTO ... SELECT ...". > > skink (valgrind) is unhappy: > > creating configuration files ... ok > running bootstrap script ... ok > performing post-bootstrap initialization ... ==4085668=