pgsql: Avoid invalid alloc size error in shm_mq

2020-10-19 Thread Peter Eisentraut
Avoid invalid alloc size error in shm_mq In shm_mq_receive(), a huge payload could trigger an unjustified "invalid memory alloc request size" error due to the way the buffer size is increased. Add error checks (documenting the upper limit) and avoid the error by limiting the allocation size to Ma

pgsql: Relax some asserts in merge join costing code

2020-10-19 Thread David Rowley
Relax some asserts in merge join costing code In the planner, it was possible, given an extreme enough case containing a large number of joins for the number of estimated rows to become infinite. This could cause problems in initial_cost_mergejoin() where we perform some calculations based on thos

pgsql: Relax some asserts in merge join costing code

2020-10-19 Thread David Rowley
Relax some asserts in merge join costing code In the planner, it was possible, given an extreme enough case containing a large number of joins for the number of estimated rows to become infinite. This could cause problems in initial_cost_mergejoin() where we perform some calculations based on thos

pgsql: Relax some asserts in merge join costing code

2020-10-19 Thread David Rowley
Relax some asserts in merge join costing code In the planner, it was possible, given an extreme enough case containing a large number of joins for the number of estimated rows to become infinite. This could cause problems in initial_cost_mergejoin() where we perform some calculations based on thos

pgsql: Relax some asserts in merge join costing code

2020-10-19 Thread David Rowley
Relax some asserts in merge join costing code In the planner, it was possible, given an extreme enough case containing a large number of joins for the number of estimated rows to become infinite. This could cause problems in initial_cost_mergejoin() where we perform some calculations based on thos

pgsql: Relax some asserts in merge join costing code

2020-10-19 Thread David Rowley
Relax some asserts in merge join costing code In the planner, it was possible, given an extreme enough case containing a large number of joins for the number of estimated rows to become infinite. This could cause problems in initial_cost_mergejoin() where we perform some calculations based on thos

pgsql: Relax some asserts in merge join costing code

2020-10-19 Thread David Rowley
Relax some asserts in merge join costing code In the planner, it was possible, given an extreme enough case containing a large number of joins for the number of estimated rows to become infinite. This could cause problems in initial_cost_mergejoin() where we perform some calculations based on thos

Re: pgsql: Change the docs for PARALLEL option of Vacuum.

2020-10-19 Thread Magnus Hagander
This seems to have broken "make dist" as well as PDF buildingon v13: https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=guaibasaurus&dt=2020-10-19%2005%3A33%3A03 https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=alabio&dt=2020-10-19%2008%3A25%3A54 HEAD looks ok. //Magnus On Mon, Oc

pgsql: Remove PartitionRoutingInfo struct.

2020-10-19 Thread Heikki Linnakangas
Remove PartitionRoutingInfo struct. The extra indirection neeeded to access its members via its enclosing ResultRelInfo seems pointless. Move all the fields from PartitionRoutingInfo to ResultRelInfo. Author: Amit Langote Reviewed-by: Alvaro Herrera Discussion: https://www.postgresql.org/message

pgsql: Clean up code to resolve the "root target relation" in nodeModif

2020-10-19 Thread Heikki Linnakangas
Clean up code to resolve the "root target relation" in nodeModifyTable.c When executing DDL on a partitioned table or on a table with inheritance children, statement-level triggers must be fired against the table given in the original statement. The code to look that up was a bit messy and duplica

pgsql: Revise child-to-root tuple conversion map management.

2020-10-19 Thread Heikki Linnakangas
Revise child-to-root tuple conversion map management. Store the tuple conversion map to convert a tuple from a child table's format to the root format in a new ri_ChildToRootMap field in ResultRelInfo. It is initialized if transition tuple capture for FOR STATEMENT triggers or INSERT tuple routing

pgsql: Update link for pllua

2020-10-19 Thread Magnus Hagander
Update link for pllua Author: Daniel Gustafsson Discussion: https://postgr.es/m/[email protected] Branch -- REL_13_STABLE Details --- https://git.postgresql.org/pg/commitdiff/d49357c0dc51378aeded51ecb8a290d761ac5b8c Modified Files -- doc/src/sgml

pgsql: Update link for pllua

2020-10-19 Thread Magnus Hagander
Update link for pllua Author: Daniel Gustafsson Discussion: https://postgr.es/m/[email protected] Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/b4d5b458e6fb4c861f92888753deea6a5005a68d Modified Files -- doc/src/sgml/extern

pgsql: Update link for pllua

2020-10-19 Thread Magnus Hagander
Update link for pllua Author: Daniel Gustafsson Discussion: https://postgr.es/m/[email protected] Branch -- REL_10_STABLE Details --- https://git.postgresql.org/pg/commitdiff/ecc173f5d35406ed8e57e5e0cc48cadcad34525f Modified Files -- doc/src/sgml

pgsql: Update link for pllua

2020-10-19 Thread Magnus Hagander
Update link for pllua Author: Daniel Gustafsson Discussion: https://postgr.es/m/[email protected] Branch -- REL_12_STABLE Details --- https://git.postgresql.org/pg/commitdiff/9b27176c3ff62bd5fae4b57b58f8723fadeb34f8 Modified Files -- doc/src/sgml

pgsql: Update link for pllua

2020-10-19 Thread Magnus Hagander
Update link for pllua Author: Daniel Gustafsson Discussion: https://postgr.es/m/[email protected] Branch -- REL_11_STABLE Details --- https://git.postgresql.org/pg/commitdiff/555b15196c67358488c8a0a395fe62deb95b2725 Modified Files -- doc/src/sgml

Re: pgsql: Change the docs for PARALLEL option of Vacuum.

2020-10-19 Thread Tom Lane
Amit Kapila writes: > Change the docs for PARALLEL option of Vacuum. The buildfarm says you broke the docs build in v13. regards, tom lane

pgsql: Fix doc for full text search distance operator.

2020-10-19 Thread Heikki Linnakangas
Fix doc for full text search distance operator. Commit 028350f619 changed its behavior from "at most" to "exactly", but forgot to update the documentation. Backpatch to 9.6. Patch by Justin Pryzby, per Yaroslav Schekin's report. Discussion: https://www.postgresql.org/message-id/20201005191922.G

pgsql: Fix doc for full text search distance operator.

2020-10-19 Thread Heikki Linnakangas
Fix doc for full text search distance operator. Commit 028350f619 changed its behavior from "at most" to "exactly", but forgot to update the documentation. Backpatch to 9.6. Patch by Justin Pryzby, per Yaroslav Schekin's report. Discussion: https://www.postgresql.org/message-id/20201005191922.G

pgsql: Fix doc for full text search distance operator.

2020-10-19 Thread Heikki Linnakangas
Fix doc for full text search distance operator. Commit 028350f619 changed its behavior from "at most" to "exactly", but forgot to update the documentation. Backpatch to 9.6. Patch by Justin Pryzby, per Yaroslav Schekin's report. Discussion: https://www.postgresql.org/message-id/20201005191922.G

pgsql: Fix doc for full text search distance operator.

2020-10-19 Thread Heikki Linnakangas
Fix doc for full text search distance operator. Commit 028350f619 changed its behavior from "at most" to "exactly", but forgot to update the documentation. Backpatch to 9.6. Patch by Justin Pryzby, per Yaroslav Schekin's report. Discussion: https://www.postgresql.org/message-id/20201005191922.G

pgsql: Fix doc for full text search distance operator.

2020-10-19 Thread Heikki Linnakangas
Fix doc for full text search distance operator. Commit 028350f619 changed its behavior from "at most" to "exactly", but forgot to update the documentation. Backpatch to 9.6. Patch by Justin Pryzby, per Yaroslav Schekin's report. Discussion: https://www.postgresql.org/message-id/20201005191922.G

pgsql: Fix doc for full text search distance operator.

2020-10-19 Thread Heikki Linnakangas
Fix doc for full text search distance operator. Commit 028350f619 changed its behavior from "at most" to "exactly", but forgot to update the documentation. Backpatch to 9.6. Patch by Justin Pryzby, per Yaroslav Schekin's report. Discussion: https://www.postgresql.org/message-id/20201005191922.G

pgsql: In libpq for Windows, call WSAStartup once and WSACleanup not at

2020-10-19 Thread Tom Lane
In libpq for Windows, call WSAStartup once and WSACleanup not at all. The Windows documentation insists that every WSAStartup call should have a matching WSACleanup call. However, if that ever had actual relevance, it wasn't in this century. Every remotely-modern Windows kernel is capable of cle

pgsql: In libpq for Windows, call WSAStartup once and WSACleanup not at

2020-10-19 Thread Tom Lane
In libpq for Windows, call WSAStartup once and WSACleanup not at all. The Windows documentation insists that every WSAStartup call should have a matching WSACleanup call. However, if that ever had actual relevance, it wasn't in this century. Every remotely-modern Windows kernel is capable of cle

pgsql: In libpq for Windows, call WSAStartup once and WSACleanup not at

2020-10-19 Thread Tom Lane
In libpq for Windows, call WSAStartup once and WSACleanup not at all. The Windows documentation insists that every WSAStartup call should have a matching WSACleanup call. However, if that ever had actual relevance, it wasn't in this century. Every remotely-modern Windows kernel is capable of cle

pgsql: In libpq for Windows, call WSAStartup once and WSACleanup not at

2020-10-19 Thread Tom Lane
In libpq for Windows, call WSAStartup once and WSACleanup not at all. The Windows documentation insists that every WSAStartup call should have a matching WSACleanup call. However, if that ever had actual relevance, it wasn't in this century. Every remotely-modern Windows kernel is capable of cle

pgsql: In libpq for Windows, call WSAStartup once and WSACleanup not at

2020-10-19 Thread Tom Lane
In libpq for Windows, call WSAStartup once and WSACleanup not at all. The Windows documentation insists that every WSAStartup call should have a matching WSACleanup call. However, if that ever had actual relevance, it wasn't in this century. Every remotely-modern Windows kernel is capable of cle

pgsql: In libpq for Windows, call WSAStartup once and WSACleanup not at

2020-10-19 Thread Tom Lane
In libpq for Windows, call WSAStartup once and WSACleanup not at all. The Windows documentation insists that every WSAStartup call should have a matching WSACleanup call. However, if that ever had actual relevance, it wasn't in this century. Every remotely-modern Windows kernel is capable of cle

pgsql: Fix output of tsquery example in docs.

2020-10-19 Thread Heikki Linnakangas
Fix output of tsquery example in docs. The output for this query changed in commit 4e2477b7b8. Backport to 9.6 like that commit. Patch by Justin Pryzby, per Yaroslav Schekin's report. Discussion: https://www.postgresql.org/message-id/20201005191922.GE17626%40telsasoft.com Branch -- REL_10_

pgsql: Fix output of tsquery example in docs.

2020-10-19 Thread Heikki Linnakangas
Fix output of tsquery example in docs. The output for this query changed in commit 4e2477b7b8. Backport to 9.6 like that commit. Patch by Justin Pryzby, per Yaroslav Schekin's report. Discussion: https://www.postgresql.org/message-id/20201005191922.GE17626%40telsasoft.com Branch -- REL_12_

pgsql: Fix output of tsquery example in docs.

2020-10-19 Thread Heikki Linnakangas
Fix output of tsquery example in docs. The output for this query changed in commit 4e2477b7b8. Backport to 9.6 like that commit. Patch by Justin Pryzby, per Yaroslav Schekin's report. Discussion: https://www.postgresql.org/message-id/20201005191922.GE17626%40telsasoft.com Branch -- master

pgsql: Fix output of tsquery example in docs.

2020-10-19 Thread Heikki Linnakangas
Fix output of tsquery example in docs. The output for this query changed in commit 4e2477b7b8. Backport to 9.6 like that commit. Patch by Justin Pryzby, per Yaroslav Schekin's report. Discussion: https://www.postgresql.org/message-id/20201005191922.GE17626%40telsasoft.com Branch -- REL9_6_

pgsql: Fix output of tsquery example in docs.

2020-10-19 Thread Heikki Linnakangas
Fix output of tsquery example in docs. The output for this query changed in commit 4e2477b7b8. Backport to 9.6 like that commit. Patch by Justin Pryzby, per Yaroslav Schekin's report. Discussion: https://www.postgresql.org/message-id/20201005191922.GE17626%40telsasoft.com Branch -- REL_13_

pgsql: Fix output of tsquery example in docs.

2020-10-19 Thread Heikki Linnakangas
Fix output of tsquery example in docs. The output for this query changed in commit 4e2477b7b8. Backport to 9.6 like that commit. Patch by Justin Pryzby, per Yaroslav Schekin's report. Discussion: https://www.postgresql.org/message-id/20201005191922.GE17626%40telsasoft.com Branch -- REL_11_

pgsql: Fix TRUNCATE doc: ALTER SEQUENCE RESTART is now transactional.

2020-10-19 Thread Heikki Linnakangas
Fix TRUNCATE doc: ALTER SEQUENCE RESTART is now transactional. ALTER SEQUENCE RESTART was made transactional in commit 3d79013b97. Backpatch to v10, where that was introduced. Patch by Justin Pryzby, per Yaroslav Schekin's report. Discussion: https://www.postgresql.org/message-id/20201005191922

pgsql: Fix TRUNCATE doc: ALTER SEQUENCE RESTART is now transactional.

2020-10-19 Thread Heikki Linnakangas
Fix TRUNCATE doc: ALTER SEQUENCE RESTART is now transactional. ALTER SEQUENCE RESTART was made transactional in commit 3d79013b97. Backpatch to v10, where that was introduced. Patch by Justin Pryzby, per Yaroslav Schekin's report. Discussion: https://www.postgresql.org/message-id/20201005191922

pgsql: Fix TRUNCATE doc: ALTER SEQUENCE RESTART is now transactional.

2020-10-19 Thread Heikki Linnakangas
Fix TRUNCATE doc: ALTER SEQUENCE RESTART is now transactional. ALTER SEQUENCE RESTART was made transactional in commit 3d79013b97. Backpatch to v10, where that was introduced. Patch by Justin Pryzby, per Yaroslav Schekin's report. Discussion: https://www.postgresql.org/message-id/20201005191922

pgsql: Fix TRUNCATE doc: ALTER SEQUENCE RESTART is now transactional.

2020-10-19 Thread Heikki Linnakangas
Fix TRUNCATE doc: ALTER SEQUENCE RESTART is now transactional. ALTER SEQUENCE RESTART was made transactional in commit 3d79013b97. Backpatch to v10, where that was introduced. Patch by Justin Pryzby, per Yaroslav Schekin's report. Discussion: https://www.postgresql.org/message-id/20201005191922

pgsql: Fix TRUNCATE doc: ALTER SEQUENCE RESTART is now transactional.

2020-10-19 Thread Heikki Linnakangas
Fix TRUNCATE doc: ALTER SEQUENCE RESTART is now transactional. ALTER SEQUENCE RESTART was made transactional in commit 3d79013b97. Backpatch to v10, where that was introduced. Patch by Justin Pryzby, per Yaroslav Schekin's report. Discussion: https://www.postgresql.org/message-id/20201005191922

pgsql: Misc documentation fixes.

2020-10-19 Thread Heikki Linnakangas
Misc documentation fixes. - Misc grammar and punctuation fixes. - Stylistic cleanup: use spaces between function arguments and JSON fields in examples. For example "foo(a,b)" -> "foo(a, b)". Add semicolon after last END in a few PL/pgSQL examples that were missing them. - Make sentence that

pgsql: Misc documentation fixes.

2020-10-19 Thread Heikki Linnakangas
Misc documentation fixes. - Misc grammar and punctuation fixes. - Stylistic cleanup: use spaces between function arguments and JSON fields in examples. For example "foo(a,b)" -> "foo(a, b)". Add semicolon after last END in a few PL/pgSQL examples that were missing them. - Make sentence that

pgsql: Misc documentation fixes.

2020-10-19 Thread Heikki Linnakangas
Misc documentation fixes. - Misc grammar and punctuation fixes. - Stylistic cleanup: use spaces between function arguments and JSON fields in examples. For example "foo(a,b)" -> "foo(a, b)". Add semicolon after last END in a few PL/pgSQL examples that were missing them. - Make sentence that

pgsql: Misc documentation fixes.

2020-10-19 Thread Heikki Linnakangas
Misc documentation fixes. - Misc grammar and punctuation fixes. - Stylistic cleanup: use spaces between function arguments and JSON fields in examples. For example "foo(a,b)" -> "foo(a, b)". Add semicolon after last END in a few PL/pgSQL examples that were missing them. - Make sentence that

pgsql: Misc documentation fixes.

2020-10-19 Thread Heikki Linnakangas
Misc documentation fixes. - Misc grammar and punctuation fixes. - Stylistic cleanup: use spaces between function arguments and JSON fields in examples. For example "foo(a,b)" -> "foo(a, b)". Add semicolon after last END in a few PL/pgSQL examples that were missing them. - Make sentence that

pgsql: Misc documentation fixes.

2020-10-19 Thread Heikki Linnakangas
Misc documentation fixes. - Misc grammar and punctuation fixes. - Stylistic cleanup: use spaces between function arguments and JSON fields in examples. For example "foo(a,b)" -> "foo(a, b)". Add semicolon after last END in a few PL/pgSQL examples that were missing them. - Make sentence that

pgsql: Misc documentation fixes.

2020-10-19 Thread Heikki Linnakangas
Misc documentation fixes. - Misc grammar and punctuation fixes. - Stylistic cleanup: use spaces between function arguments and JSON fields in examples. For example "foo(a,b)" -> "foo(a, b)". Add semicolon after last END in a few PL/pgSQL examples that were missing them. - Make sentence that

pgsql: Fix list-munging bug that broke SQL function result coercions.

2020-10-19 Thread Tom Lane
Fix list-munging bug that broke SQL function result coercions. Since commit 913bbd88d, check_sql_fn_retval() can either insert type coercion steps in-line in the Query that produces the SQL function's results, or generate a new top-level Query to perform the coercions, if modifying the Query's out

pgsql: Fix list-munging bug that broke SQL function result coercions.

2020-10-19 Thread Tom Lane
Fix list-munging bug that broke SQL function result coercions. Since commit 913bbd88d, check_sql_fn_retval() can either insert type coercion steps in-line in the Query that produces the SQL function's results, or generate a new top-level Query to perform the coercions, if modifying the Query's out

pgsql: Fix connection string handling in src/bin/scripts/ programs.

2020-10-19 Thread Tom Lane
Fix connection string handling in src/bin/scripts/ programs. When told to process all databases, clusterdb, reindexdb, and vacuumdb would reconnect by replacing their --maintenance-db parameter with the name of the target database. If that parameter is a connstring (which has been allowed for a l

pgsql: Fix connection string handling in src/bin/scripts/ programs.

2020-10-19 Thread Tom Lane
Fix connection string handling in src/bin/scripts/ programs. When told to process all databases, clusterdb, reindexdb, and vacuumdb would reconnect by replacing their --maintenance-db parameter with the name of the target database. If that parameter is a connstring (which has been allowed for a l

pgsql: Fix connection string handling in src/bin/scripts/ programs.

2020-10-19 Thread Tom Lane
Fix connection string handling in src/bin/scripts/ programs. When told to process all databases, clusterdb, reindexdb, and vacuumdb would reconnect by replacing their --maintenance-db parameter with the name of the target database. If that parameter is a connstring (which has been allowed for a l

pgsql: Fix connection string handling in src/bin/scripts/ programs.

2020-10-19 Thread Tom Lane
Fix connection string handling in src/bin/scripts/ programs. When told to process all databases, clusterdb, reindexdb, and vacuumdb would reconnect by replacing their --maintenance-db parameter with the name of the target database. If that parameter is a connstring (which has been allowed for a l

pgsql: Fix connection string handling in src/bin/scripts/ programs.

2020-10-19 Thread Tom Lane
Fix connection string handling in src/bin/scripts/ programs. When told to process all databases, clusterdb, reindexdb, and vacuumdb would reconnect by replacing their --maintenance-db parameter with the name of the target database. If that parameter is a connstring (which has been allowed for a l

pgsql: Fix connection string handling in src/bin/scripts/ programs.

2020-10-19 Thread Tom Lane
Fix connection string handling in src/bin/scripts/ programs. When told to process all databases, clusterdb, reindexdb, and vacuumdb would reconnect by replacing their --maintenance-db parameter with the name of the target database. If that parameter is a connstring (which has been allowed for a l

pgsql: Fix connection string handling in src/bin/scripts/ programs.

2020-10-19 Thread Tom Lane
Fix connection string handling in src/bin/scripts/ programs. When told to process all databases, clusterdb, reindexdb, and vacuumdb would reconnect by replacing their --maintenance-db parameter with the name of the target database. If that parameter is a connstring (which has been allowed for a l

Re: pgsql: Change the docs for PARALLEL option of Vacuum.

2020-10-19 Thread Amit Kapila
On Mon, Oct 19, 2020 at 8:13 PM Tom Lane wrote: > > Amit Kapila writes: > > Change the docs for PARALLEL option of Vacuum. > > The buildfarm says you broke the docs build in v13. > oops, I'll look into it. -- With Regards, Amit Kapila.

pgsql: Fix typo in commit 99ae342fc4.

2020-10-19 Thread Amit Kapila
Fix typo in commit 99ae342fc4. In v13, the id for max_parallel_maintenance_workers is defined differently as compared to HEAD in docs, so adjust the docs accordingly. Reported-by: Magnus Hagander and Tom Lane Discussion: https://postgr.es/m/CABUevEyAFQZ_jvjY_KtRUWbci4YMyQC1QAMzDQAbLs=xco3...@mai

pgsql: Change the attribute name in pg_stat_replication_slots view.

2020-10-19 Thread Amit Kapila
Change the attribute name in pg_stat_replication_slots view. Change the attribute 'name' to 'slot_name' in pg_stat_replication_slots view to make it clear and that way we will be consistent with the other places like pg_stat_wal_receiver view where we display the same attribute. In the passing, f