pgsql: Avoid invalid alloc size error in shm_mq
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 MaxAllocSize. Author: Markus Wanner Discussion: https://www.postgresql.org/message-id/flat/3bb363e7-ac04-0ac4-9fe8-db1148755bfa%402ndquadrant.com Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/26ec6b5948a73d0e07ed9435ee4554594acdf34f Modified Files -- src/backend/storage/ipc/shm_mq.c | 24 1 file changed, 24 insertions(+)
pgsql: Relax some asserts in merge join costing code
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 those row estimates. A problem case, presented by Onder Kalaci showed an Assert failure from an Assert checking outerstartsel <= outerendsel. In his test case this was effectively NaN <= Inf, which is false. The NaN outerstartsel came from multiplying the infinite outer_path_rows by 0.0. In master, this problem was fixed by a90c950fc, however, that fix was too invasive for the backbranches. Here we just relax the Asserts to allow them to pass. The worst that appears to happen from this is that we show NaN cost values and infinite row estimates in EXPLAIN. add_path() would have had a hard time doing anything useful with such costs, but that does not really matter as if the row estimates were even close to accurate, such plan would not complete this side of the heat death of the universe. Reported-by: Onder Kalaci Backpatch: 9.5 to 13 Discussion: https://postgr.es/m/dm6pr21mb1211ff360183bca901b27f04d8...@dm6pr21mb1211.namprd21.prod.outlook.com Branch -- REL9_5_STABLE Details --- https://git.postgresql.org/pg/commitdiff/3798b4fe73b97147f67847bcb611283acd9fb0d4 Modified Files -- src/backend/optimizer/path/costsize.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-)
pgsql: Relax some asserts in merge join costing code
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 those row estimates. A problem case, presented by Onder Kalaci showed an Assert failure from an Assert checking outerstartsel <= outerendsel. In his test case this was effectively NaN <= Inf, which is false. The NaN outerstartsel came from multiplying the infinite outer_path_rows by 0.0. In master, this problem was fixed by a90c950fc, however, that fix was too invasive for the backbranches. Here we just relax the Asserts to allow them to pass. The worst that appears to happen from this is that we show NaN cost values and infinite row estimates in EXPLAIN. add_path() would have had a hard time doing anything useful with such costs, but that does not really matter as if the row estimates were even close to accurate, such plan would not complete this side of the heat death of the universe. Reported-by: Onder Kalaci Backpatch: 9.5 to 13 Discussion: https://postgr.es/m/dm6pr21mb1211ff360183bca901b27f04d8...@dm6pr21mb1211.namprd21.prod.outlook.com Branch -- REL9_6_STABLE Details --- https://git.postgresql.org/pg/commitdiff/00fecc24c140b965e0bdd00942f07f0d43983d7d Modified Files -- src/backend/optimizer/path/costsize.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-)
pgsql: Relax some asserts in merge join costing code
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 those row estimates. A problem case, presented by Onder Kalaci showed an Assert failure from an Assert checking outerstartsel <= outerendsel. In his test case this was effectively NaN <= Inf, which is false. The NaN outerstartsel came from multiplying the infinite outer_path_rows by 0.0. In master, this problem was fixed by a90c950fc, however, that fix was too invasive for the backbranches. Here we just relax the Asserts to allow them to pass. The worst that appears to happen from this is that we show NaN cost values and infinite row estimates in EXPLAIN. add_path() would have had a hard time doing anything useful with such costs, but that does not really matter as if the row estimates were even close to accurate, such plan would not complete this side of the heat death of the universe. Reported-by: Onder Kalaci Backpatch: 9.5 to 13 Discussion: https://postgr.es/m/dm6pr21mb1211ff360183bca901b27f04d8...@dm6pr21mb1211.namprd21.prod.outlook.com Branch -- REL_10_STABLE Details --- https://git.postgresql.org/pg/commitdiff/600c2412f850269b4c81b6f7468ba1c2f4913993 Modified Files -- src/backend/optimizer/path/costsize.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-)
pgsql: Relax some asserts in merge join costing code
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 those row estimates. A problem case, presented by Onder Kalaci showed an Assert failure from an Assert checking outerstartsel <= outerendsel. In his test case this was effectively NaN <= Inf, which is false. The NaN outerstartsel came from multiplying the infinite outer_path_rows by 0.0. In master, this problem was fixed by a90c950fc, however, that fix was too invasive for the backbranches. Here we just relax the Asserts to allow them to pass. The worst that appears to happen from this is that we show NaN cost values and infinite row estimates in EXPLAIN. add_path() would have had a hard time doing anything useful with such costs, but that does not really matter as if the row estimates were even close to accurate, such plan would not complete this side of the heat death of the universe. Reported-by: Onder Kalaci Backpatch: 9.5 to 13 Discussion: https://postgr.es/m/dm6pr21mb1211ff360183bca901b27f04d8...@dm6pr21mb1211.namprd21.prod.outlook.com Branch -- REL_11_STABLE Details --- https://git.postgresql.org/pg/commitdiff/2681bb230a68400ea34c68f9df76e24f51b4bb25 Modified Files -- src/backend/optimizer/path/costsize.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-)
pgsql: Relax some asserts in merge join costing code
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 those row estimates. A problem case, presented by Onder Kalaci showed an Assert failure from an Assert checking outerstartsel <= outerendsel. In his test case this was effectively NaN <= Inf, which is false. The NaN outerstartsel came from multiplying the infinite outer_path_rows by 0.0. In master, this problem was fixed by a90c950fc, however, that fix was too invasive for the backbranches. Here we just relax the Asserts to allow them to pass. The worst that appears to happen from this is that we show NaN cost values and infinite row estimates in EXPLAIN. add_path() would have had a hard time doing anything useful with such costs, but that does not really matter as if the row estimates were even close to accurate, such plan would not complete this side of the heat death of the universe. Reported-by: Onder Kalaci Backpatch: 9.5 to 13 Discussion: https://postgr.es/m/dm6pr21mb1211ff360183bca901b27f04d8...@dm6pr21mb1211.namprd21.prod.outlook.com Branch -- REL_12_STABLE Details --- https://git.postgresql.org/pg/commitdiff/77ca44b76477ae4efbac0766b578607e1d261383 Modified Files -- src/backend/optimizer/path/costsize.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-)
pgsql: Relax some asserts in merge join costing code
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 those row estimates. A problem case, presented by Onder Kalaci showed an Assert failure from an Assert checking outerstartsel <= outerendsel. In his test case this was effectively NaN <= Inf, which is false. The NaN outerstartsel came from multiplying the infinite outer_path_rows by 0.0. In master, this problem was fixed by a90c950fc, however, that fix was too invasive for the backbranches. Here we just relax the Asserts to allow them to pass. The worst that appears to happen from this is that we show NaN cost values and infinite row estimates in EXPLAIN. add_path() would have had a hard time doing anything useful with such costs, but that does not really matter as if the row estimates were even close to accurate, such plan would not complete this side of the heat death of the universe. Reported-by: Onder Kalaci Backpatch: 9.5 to 13 Discussion: https://postgr.es/m/dm6pr21mb1211ff360183bca901b27f04d8...@dm6pr21mb1211.namprd21.prod.outlook.com Branch -- REL_13_STABLE Details --- https://git.postgresql.org/pg/commitdiff/33a332bc1cff27c5138fe117ae56b6a6f476f30c Modified Files -- src/backend/optimizer/path/costsize.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-)
Re: pgsql: Change the docs for PARALLEL option of Vacuum.
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, Oct 19, 2020 at 6:21 AM Amit Kapila wrote: > Change the docs for PARALLEL option of Vacuum. > > The rules to choose the number of parallel workers to perform parallel > vacuum operation were not clearly specified. > > Reported-by: Peter Eisentraut > Author: Amit Kapila > Backpatch-through: 13, where it was introduced > Discussion: > https://postgr.es/m/[email protected] > > Branch > -- > REL_13_STABLE > > Details > --- > > https://git.postgresql.org/pg/commitdiff/99ae342fc4ffe5f9a6ec7f540c5a31fb483b06e6 > > Modified Files > -- > doc/src/sgml/ref/vacuum.sgml | 32 > 1 file changed, 16 insertions(+), 16 deletions(-) > >
pgsql: Remove PartitionRoutingInfo struct.
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-id/CA%2BHiwqFViT47Zbr_ASBejiK7iDG8%3DQ1swQ-tjM6caRPQ67pT%3Dw%40mail.gmail.com Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/fb5883da86154c3126264bfd97b0cd6f293bcebd Modified Files -- src/backend/commands/copy.c | 4 ++-- src/backend/executor/execMain.c | 4 +++- src/backend/executor/execPartition.c | 34 src/backend/executor/nodeModifyTable.c | 21 +--- src/backend/replication/logical/worker.c | 11 --- src/include/executor/execPartition.h | 21 src/include/nodes/execnodes.h| 15 +- 7 files changed, 45 insertions(+), 65 deletions(-)
pgsql: Clean up code to resolve the "root target relation" in nodeModif
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 duplicative. Commit 501ed02cf6 added a helper function, getASTriggerResultRelInfo() (later renamed to getTargetResultRelInfo()) for it, but for some reason it was only used when firing AFTER STATEMENT triggers and the code to fire BEFORE STATEMENT triggers duplicated the logic. Determine the target relation in ExecInitModifyTable(), and set it always in ModifyTableState. Code that used to call getTargetResultRelInfo() can now use ModifyTableState->rootResultRelInfo directly. Discussion: https://www.postgresql.org/message-id/CA%2BHiwqFViT47Zbr_ASBejiK7iDG8%3DQ1swQ-tjM6caRPQ67pT%3Dw%40mail.gmail.com Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/f49b85d783f6781138f33bbe5f6e98da86907d84 Modified Files -- src/backend/executor/nodeModifyTable.c | 62 +- src/include/nodes/execnodes.h | 9 +++-- 2 files changed, 31 insertions(+), 40 deletions(-)
pgsql: Revise child-to-root tuple conversion map management.
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 on a partitioned table is needed. Previously, ModifyTable kept the maps in the per-subplan ModifyTableState->mt_per_subplan_tupconv_maps array, or when tuple routing was used, in ResultRelInfo->ri_Partitioninfo->pi_PartitionToRootMap. The new field replaces both of those. Now that the child-to-root tuple conversion map is always available in ResultRelInfo (when needed), remove the TransitionCaptureState.tcs_map field. The callers of Exec*Trigger() functions no longer need to set or save it, which is much less confusing and bug-prone. Also, as a future optimization, this will allow us to delay creating the map for a given result relation until the relation is actually processed during execution. Author: Amit Langote Discussion: https://www.postgresql.org/message-id/CA%2BHiwqHtCWLdK-LO%3DNEsvOdHx%2B7yv4mE_zYK0i3BH7dXb-wxog%40mail.gmail.com Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/6973533650c04653d9018f61c1ac99ecb11094bd Modified Files -- src/backend/commands/copy.c| 29 + src/backend/commands/trigger.c | 10 +- src/backend/executor/execMain.c| 1 + src/backend/executor/execPartition.c | 23 ++-- src/backend/executor/nodeModifyTable.c | 210 + src/include/commands/trigger.h | 10 +- src/include/executor/execPartition.h | 6 - src/include/nodes/execnodes.h | 10 +- 8 files changed, 84 insertions(+), 215 deletions(-)
pgsql: Update link for pllua
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/external-projects.sgml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
pgsql: Update link for pllua
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/external-projects.sgml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
pgsql: Update link for pllua
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/external-projects.sgml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
pgsql: Update link for pllua
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/external-projects.sgml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
pgsql: Update link for pllua
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/external-projects.sgml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Re: pgsql: Change the docs for PARALLEL option of Vacuum.
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.
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.GE17626%40telsasoft.com Branch -- REL_10_STABLE Details --- https://git.postgresql.org/pg/commitdiff/71cb2e43cde69b58cf7bbc7156a61ba4124a8bc3 Modified Files -- doc/src/sgml/textsearch.sgml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
pgsql: Fix doc for full text search distance operator.
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.GE17626%40telsasoft.com Branch -- REL9_6_STABLE Details --- https://git.postgresql.org/pg/commitdiff/8ae447e2f7cd1a60e715f624dc7fe1e1a768e7ab Modified Files -- doc/src/sgml/textsearch.sgml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
pgsql: Fix doc for full text search distance operator.
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.GE17626%40telsasoft.com Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/1a64c7636f24096155f7aa15d7164eba3cdef075 Modified Files -- doc/src/sgml/textsearch.sgml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
pgsql: Fix doc for full text search distance operator.
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.GE17626%40telsasoft.com Branch -- REL_11_STABLE Details --- https://git.postgresql.org/pg/commitdiff/aa560d3a6b3750233203ad33354aa65104fab310 Modified Files -- doc/src/sgml/textsearch.sgml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
pgsql: Fix doc for full text search distance operator.
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.GE17626%40telsasoft.com Branch -- REL_12_STABLE Details --- https://git.postgresql.org/pg/commitdiff/f0e92bc4b0d783d700058f457a09d6c31e7edb01 Modified Files -- doc/src/sgml/textsearch.sgml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
pgsql: Fix doc for full text search distance operator.
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.GE17626%40telsasoft.com Branch -- REL_13_STABLE Details --- https://git.postgresql.org/pg/commitdiff/f2f03f9bb10b0749eddea5ad1dd730926421f090 Modified Files -- doc/src/sgml/textsearch.sgml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
pgsql: In libpq for Windows, call WSAStartup once and WSACleanup not at
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 cleaning up when a process exits without doing that, and must be so to avoid resource leaks in case of a process crash. Moreover, Postgres backends have done WSAStartup without WSACleanup since commit 4cdf51e64 in 2004, and we've never seen any indication of a problem with that. libpq's habit of doing WSAStartup during connection start and WSACleanup during shutdown is also rather inefficient, since a series of non-overlapping connection requests leads to repeated, quite expensive DLL unload/reload cycles. We document a workaround for that (having the application call WSAStartup for itself), but that's just a kluge. It's also worth noting that it's far from uncommon for applications to exit without doing PQfinish, and we've not heard reports of trouble from that either. However, the real reason for acting on this is that recent experiments by Alexander Lakhin show that calling WSACleanup during PQfinish is triggering the symptom we occasionally see that a process using libpq fails to emit expected stdio output. Therefore, let's change libpq so that it calls WSAStartup only once per process, during the first connection attempt, and never calls WSACleanup at all. While at it, get rid of the only other WSACleanup call in our code tree, in pg_dump/parallel.c; that presumably is equally useless. Back-patch of HEAD commit 7d00a6b2d. Discussion: https://postgr.es/m/[email protected] Branch -- REL_10_STABLE Details --- https://git.postgresql.org/pg/commitdiff/6670e91078b3cc7927b9a16d2082586bef63b547 Modified Files -- doc/src/sgml/libpq.sgml | 15 --- src/bin/pg_dump/parallel.c| 16 +--- src/interfaces/libpq/fe-connect.c | 31 +-- 3 files changed, 18 insertions(+), 44 deletions(-)
pgsql: In libpq for Windows, call WSAStartup once and WSACleanup not at
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 cleaning up when a process exits without doing that, and must be so to avoid resource leaks in case of a process crash. Moreover, Postgres backends have done WSAStartup without WSACleanup since commit 4cdf51e64 in 2004, and we've never seen any indication of a problem with that. libpq's habit of doing WSAStartup during connection start and WSACleanup during shutdown is also rather inefficient, since a series of non-overlapping connection requests leads to repeated, quite expensive DLL unload/reload cycles. We document a workaround for that (having the application call WSAStartup for itself), but that's just a kluge. It's also worth noting that it's far from uncommon for applications to exit without doing PQfinish, and we've not heard reports of trouble from that either. However, the real reason for acting on this is that recent experiments by Alexander Lakhin show that calling WSACleanup during PQfinish is triggering the symptom we occasionally see that a process using libpq fails to emit expected stdio output. Therefore, let's change libpq so that it calls WSAStartup only once per process, during the first connection attempt, and never calls WSACleanup at all. While at it, get rid of the only other WSACleanup call in our code tree, in pg_dump/parallel.c; that presumably is equally useless. Back-patch of HEAD commit 7d00a6b2d. Discussion: https://postgr.es/m/[email protected] Branch -- REL_13_STABLE Details --- https://git.postgresql.org/pg/commitdiff/d2074daebe1699f0d48fa63f6ba196b6426023ad Modified Files -- doc/src/sgml/libpq.sgml | 15 --- src/bin/pg_dump/parallel.c| 16 +--- src/interfaces/libpq/fe-connect.c | 31 +-- 3 files changed, 18 insertions(+), 44 deletions(-)
pgsql: In libpq for Windows, call WSAStartup once and WSACleanup not at
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 cleaning up when a process exits without doing that, and must be so to avoid resource leaks in case of a process crash. Moreover, Postgres backends have done WSAStartup without WSACleanup since commit 4cdf51e64 in 2004, and we've never seen any indication of a problem with that. libpq's habit of doing WSAStartup during connection start and WSACleanup during shutdown is also rather inefficient, since a series of non-overlapping connection requests leads to repeated, quite expensive DLL unload/reload cycles. We document a workaround for that (having the application call WSAStartup for itself), but that's just a kluge. It's also worth noting that it's far from uncommon for applications to exit without doing PQfinish, and we've not heard reports of trouble from that either. However, the real reason for acting on this is that recent experiments by Alexander Lakhin show that calling WSACleanup during PQfinish is triggering the symptom we occasionally see that a process using libpq fails to emit expected stdio output. Therefore, let's change libpq so that it calls WSAStartup only once per process, during the first connection attempt, and never calls WSACleanup at all. While at it, get rid of the only other WSACleanup call in our code tree, in pg_dump/parallel.c; that presumably is equally useless. Back-patch of HEAD commit 7d00a6b2d. Discussion: https://postgr.es/m/[email protected] Branch -- REL_11_STABLE Details --- https://git.postgresql.org/pg/commitdiff/883226441d673ffc4d5fbdd57396030e5648155c Modified Files -- doc/src/sgml/libpq.sgml | 15 --- src/bin/pg_dump/parallel.c| 16 +--- src/interfaces/libpq/fe-connect.c | 31 +-- 3 files changed, 18 insertions(+), 44 deletions(-)
pgsql: In libpq for Windows, call WSAStartup once and WSACleanup not at
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 cleaning up when a process exits without doing that, and must be so to avoid resource leaks in case of a process crash. Moreover, Postgres backends have done WSAStartup without WSACleanup since commit 4cdf51e64 in 2004, and we've never seen any indication of a problem with that. libpq's habit of doing WSAStartup during connection start and WSACleanup during shutdown is also rather inefficient, since a series of non-overlapping connection requests leads to repeated, quite expensive DLL unload/reload cycles. We document a workaround for that (having the application call WSAStartup for itself), but that's just a kluge. It's also worth noting that it's far from uncommon for applications to exit without doing PQfinish, and we've not heard reports of trouble from that either. However, the real reason for acting on this is that recent experiments by Alexander Lakhin show that calling WSACleanup during PQfinish is triggering the symptom we occasionally see that a process using libpq fails to emit expected stdio output. Therefore, let's change libpq so that it calls WSAStartup only once per process, during the first connection attempt, and never calls WSACleanup at all. While at it, get rid of the only other WSACleanup call in our code tree, in pg_dump/parallel.c; that presumably is equally useless. Back-patch of HEAD commit 7d00a6b2d. Discussion: https://postgr.es/m/[email protected] Branch -- REL9_6_STABLE Details --- https://git.postgresql.org/pg/commitdiff/cdc7ace161d39ed788e4e169763c80b58d5bd9c1 Modified Files -- doc/src/sgml/libpq.sgml | 15 --- src/bin/pg_dump/parallel.c| 16 +--- src/interfaces/libpq/fe-connect.c | 31 +-- 3 files changed, 18 insertions(+), 44 deletions(-)
pgsql: In libpq for Windows, call WSAStartup once and WSACleanup not at
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 cleaning up when a process exits without doing that, and must be so to avoid resource leaks in case of a process crash. Moreover, Postgres backends have done WSAStartup without WSACleanup since commit 4cdf51e64 in 2004, and we've never seen any indication of a problem with that. libpq's habit of doing WSAStartup during connection start and WSACleanup during shutdown is also rather inefficient, since a series of non-overlapping connection requests leads to repeated, quite expensive DLL unload/reload cycles. We document a workaround for that (having the application call WSAStartup for itself), but that's just a kluge. It's also worth noting that it's far from uncommon for applications to exit without doing PQfinish, and we've not heard reports of trouble from that either. However, the real reason for acting on this is that recent experiments by Alexander Lakhin show that calling WSACleanup during PQfinish is triggering the symptom we occasionally see that a process using libpq fails to emit expected stdio output. Therefore, let's change libpq so that it calls WSAStartup only once per process, during the first connection attempt, and never calls WSACleanup at all. While at it, get rid of the only other WSACleanup call in our code tree, in pg_dump/parallel.c; that presumably is equally useless. Back-patch of HEAD commit 7d00a6b2d. Discussion: https://postgr.es/m/[email protected] Branch -- REL9_5_STABLE Details --- https://git.postgresql.org/pg/commitdiff/6acc31a201d84ff795b0d0f5a4b3a0ec1730347a Modified Files -- doc/src/sgml/libpq.sgml | 15 --- src/bin/pg_dump/parallel.c| 16 +--- src/interfaces/libpq/fe-connect.c | 31 +-- 3 files changed, 18 insertions(+), 44 deletions(-)
pgsql: In libpq for Windows, call WSAStartup once and WSACleanup not at
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 cleaning up when a process exits without doing that, and must be so to avoid resource leaks in case of a process crash. Moreover, Postgres backends have done WSAStartup without WSACleanup since commit 4cdf51e64 in 2004, and we've never seen any indication of a problem with that. libpq's habit of doing WSAStartup during connection start and WSACleanup during shutdown is also rather inefficient, since a series of non-overlapping connection requests leads to repeated, quite expensive DLL unload/reload cycles. We document a workaround for that (having the application call WSAStartup for itself), but that's just a kluge. It's also worth noting that it's far from uncommon for applications to exit without doing PQfinish, and we've not heard reports of trouble from that either. However, the real reason for acting on this is that recent experiments by Alexander Lakhin show that calling WSACleanup during PQfinish is triggering the symptom we occasionally see that a process using libpq fails to emit expected stdio output. Therefore, let's change libpq so that it calls WSAStartup only once per process, during the first connection attempt, and never calls WSACleanup at all. While at it, get rid of the only other WSACleanup call in our code tree, in pg_dump/parallel.c; that presumably is equally useless. Back-patch of HEAD commit 7d00a6b2d. Discussion: https://postgr.es/m/[email protected] Branch -- REL_12_STABLE Details --- https://git.postgresql.org/pg/commitdiff/407580aabb831f933234c91991387b2ba3fe2318 Modified Files -- doc/src/sgml/libpq.sgml | 15 --- src/bin/pg_dump/parallel.c| 16 +--- src/interfaces/libpq/fe-connect.c | 31 +-- 3 files changed, 18 insertions(+), 44 deletions(-)
pgsql: Fix output of tsquery example in docs.
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_STABLE Details --- https://git.postgresql.org/pg/commitdiff/609fe21c0dbd50cd5e3d13a73ea2f757fdfc75ff Modified Files -- doc/src/sgml/textsearch.sgml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
pgsql: Fix output of tsquery example in docs.
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_STABLE Details --- https://git.postgresql.org/pg/commitdiff/660cbe807596399c34e56f7ff2554a39cde0f70c Modified Files -- doc/src/sgml/textsearch.sgml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
pgsql: Fix output of tsquery example in docs.
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 Details --- https://git.postgresql.org/pg/commitdiff/c0bc4c682ee2a84dee2b562db3d17d173a6abc06 Modified Files -- doc/src/sgml/textsearch.sgml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
pgsql: Fix output of tsquery example in docs.
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_STABLE Details --- https://git.postgresql.org/pg/commitdiff/07d46e7e077f5a1c1d6b5d7c9c8fff51c66d54e5 Modified Files -- doc/src/sgml/textsearch.sgml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
pgsql: Fix output of tsquery example in docs.
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_STABLE Details --- https://git.postgresql.org/pg/commitdiff/f0b3d3bb89ae34281edc49de24f865af85671a37 Modified Files -- doc/src/sgml/textsearch.sgml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
pgsql: Fix output of tsquery example in docs.
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_STABLE Details --- https://git.postgresql.org/pg/commitdiff/cf01ade424cfac4c68ab00fe61bc65790448e6bb Modified Files -- doc/src/sgml/textsearch.sgml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
pgsql: Fix TRUNCATE doc: ALTER SEQUENCE RESTART is now transactional.
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.GE17626%40telsasoft.com Branch -- REL_10_STABLE Details --- https://git.postgresql.org/pg/commitdiff/d348473b783c37a1937065812217eb269b8f2613 Modified Files -- doc/src/sgml/ref/truncate.sgml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
pgsql: Fix TRUNCATE doc: ALTER SEQUENCE RESTART is now transactional.
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.GE17626%40telsasoft.com Branch -- REL_13_STABLE Details --- https://git.postgresql.org/pg/commitdiff/3b5bf7b893fc70d298881cff14f7f0c82d8fee34 Modified Files -- doc/src/sgml/ref/truncate.sgml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
pgsql: Fix TRUNCATE doc: ALTER SEQUENCE RESTART is now transactional.
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.GE17626%40telsasoft.com Branch -- REL_12_STABLE Details --- https://git.postgresql.org/pg/commitdiff/c092b2ee235e125cc1f8b727052398683bd88428 Modified Files -- doc/src/sgml/ref/truncate.sgml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
pgsql: Fix TRUNCATE doc: ALTER SEQUENCE RESTART is now transactional.
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.GE17626%40telsasoft.com Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/2a972e0165c9b34da4cff3001a2dad8e5a9a5a2b Modified Files -- doc/src/sgml/ref/truncate.sgml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
pgsql: Fix TRUNCATE doc: ALTER SEQUENCE RESTART is now transactional.
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.GE17626%40telsasoft.com Branch -- REL_11_STABLE Details --- https://git.postgresql.org/pg/commitdiff/1800686383f7f9b5c5fa373fb912d9d4c8c162d7 Modified Files -- doc/src/sgml/ref/truncate.sgml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
pgsql: Misc documentation fixes.
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 talked about "..." and ".." operators more clear, by avoiding to end the sentence with "..". That makes it look the same as "..." - Fix syntax description for HAVING: HAVING conditions cannot be repeated Patch by Justin Pryzby, per Yaroslav Schekin's report. Backpatch to all supported versions, to the extent that the patch applies easily. Discussion: https://www.postgresql.org/message-id/20201005191922.GE17626%40telsasoft.com Branch -- REL_12_STABLE Details --- https://git.postgresql.org/pg/commitdiff/7e175c53d997a67f771d6a6bdc5a85a0fe99db00 Modified Files -- doc/src/sgml/catalogs.sgml | 2 +- doc/src/sgml/config.sgml| 4 ++-- doc/src/sgml/dblink.sgml| 8 doc/src/sgml/func.sgml | 2 +- doc/src/sgml/gin.sgml | 2 +- doc/src/sgml/high-availability.sgml | 2 +- doc/src/sgml/indexam.sgml | 2 +- doc/src/sgml/isn.sgml | 2 +- doc/src/sgml/mvcc.sgml | 2 +- doc/src/sgml/parallel.sgml | 2 +- doc/src/sgml/plpgsql.sgml | 12 ++-- doc/src/sgml/protocol.sgml | 2 +- doc/src/sgml/ref/select.sgml| 2 +- doc/src/sgml/ref/select_into.sgml | 2 +- doc/src/sgml/rules.sgml | 6 +++--- doc/src/sgml/seg.sgml | 4 ++-- doc/src/sgml/textsearch.sgml| 30 +++--- 17 files changed, 43 insertions(+), 43 deletions(-)
pgsql: Misc documentation fixes.
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 talked about "..." and ".." operators more clear, by avoiding to end the sentence with "..". That makes it look the same as "..." - Fix syntax description for HAVING: HAVING conditions cannot be repeated Patch by Justin Pryzby, per Yaroslav Schekin's report. Backpatch to all supported versions, to the extent that the patch applies easily. Discussion: https://www.postgresql.org/message-id/20201005191922.GE17626%40telsasoft.com Branch -- REL_13_STABLE Details --- https://git.postgresql.org/pg/commitdiff/33acc6bc8795d8e3c2802c78e17e57a75a143904 Modified Files -- doc/src/sgml/catalogs.sgml | 2 +- doc/src/sgml/config.sgml| 4 ++-- doc/src/sgml/dblink.sgml| 8 doc/src/sgml/func.sgml | 32 doc/src/sgml/gin.sgml | 2 +- doc/src/sgml/high-availability.sgml | 2 +- doc/src/sgml/hstore.sgml| 10 +- doc/src/sgml/indexam.sgml | 2 +- doc/src/sgml/isn.sgml | 2 +- doc/src/sgml/ltree.sgml | 12 ++-- doc/src/sgml/mvcc.sgml | 2 +- doc/src/sgml/parallel.sgml | 2 +- doc/src/sgml/plpgsql.sgml | 12 ++-- doc/src/sgml/protocol.sgml | 2 +- doc/src/sgml/ref/select.sgml| 2 +- doc/src/sgml/ref/select_into.sgml | 2 +- doc/src/sgml/rules.sgml | 6 +++--- doc/src/sgml/seg.sgml | 4 ++-- doc/src/sgml/textsearch.sgml| 30 +++--- 19 files changed, 69 insertions(+), 69 deletions(-)
pgsql: Misc documentation fixes.
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 talked about "..." and ".." operators more clear, by avoiding to end the sentence with "..". That makes it look the same as "..." - Fix syntax description for HAVING: HAVING conditions cannot be repeated Patch by Justin Pryzby, per Yaroslav Schekin's report. Backpatch to all supported versions, to the extent that the patch applies easily. Discussion: https://www.postgresql.org/message-id/20201005191922.GE17626%40telsasoft.com Branch -- REL9_5_STABLE Details --- https://git.postgresql.org/pg/commitdiff/660376397e0e45a8e6d9fe241a161bd6df45346e Modified Files -- doc/src/sgml/catalogs.sgml | 2 +- doc/src/sgml/config.sgml| 4 ++-- doc/src/sgml/dblink.sgml| 8 doc/src/sgml/func.sgml | 2 +- doc/src/sgml/gin.sgml | 4 ++-- doc/src/sgml/high-availability.sgml | 2 +- doc/src/sgml/isn.sgml | 2 +- doc/src/sgml/mvcc.sgml | 2 +- doc/src/sgml/plpgsql.sgml | 8 doc/src/sgml/ref/select.sgml| 2 +- doc/src/sgml/ref/select_into.sgml | 2 +- doc/src/sgml/rules.sgml | 6 +++--- doc/src/sgml/seg.sgml | 4 ++-- doc/src/sgml/textsearch.sgml| 30 +++--- 14 files changed, 39 insertions(+), 39 deletions(-)
pgsql: Misc documentation fixes.
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 talked about "..." and ".." operators more clear, by avoiding to end the sentence with "..". That makes it look the same as "..." - Fix syntax description for HAVING: HAVING conditions cannot be repeated Patch by Justin Pryzby, per Yaroslav Schekin's report. Backpatch to all supported versions, to the extent that the patch applies easily. Discussion: https://www.postgresql.org/message-id/20201005191922.GE17626%40telsasoft.com Branch -- REL_10_STABLE Details --- https://git.postgresql.org/pg/commitdiff/463bef28d8f2c85048fe5ecab0df8f4fb0924e1e Modified Files -- doc/src/sgml/catalogs.sgml | 2 +- doc/src/sgml/config.sgml| 4 ++-- doc/src/sgml/dblink.sgml| 8 doc/src/sgml/func.sgml | 2 +- doc/src/sgml/gin.sgml | 4 ++-- doc/src/sgml/high-availability.sgml | 2 +- doc/src/sgml/isn.sgml | 2 +- doc/src/sgml/mvcc.sgml | 2 +- doc/src/sgml/parallel.sgml | 2 +- doc/src/sgml/plpgsql.sgml | 8 doc/src/sgml/protocol.sgml | 2 +- doc/src/sgml/ref/select.sgml| 2 +- doc/src/sgml/ref/select_into.sgml | 2 +- doc/src/sgml/rules.sgml | 6 +++--- doc/src/sgml/seg.sgml | 4 ++-- doc/src/sgml/textsearch.sgml| 30 +++--- 16 files changed, 41 insertions(+), 41 deletions(-)
pgsql: Misc documentation fixes.
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 talked about "..." and ".." operators more clear, by avoiding to end the sentence with "..". That makes it look the same as "..." - Fix syntax description for HAVING: HAVING conditions cannot be repeated Patch by Justin Pryzby, per Yaroslav Schekin's report. Backpatch to all supported versions, to the extent that the patch applies easily. Discussion: https://www.postgresql.org/message-id/20201005191922.GE17626%40telsasoft.com Branch -- REL9_6_STABLE Details --- https://git.postgresql.org/pg/commitdiff/67a6af69870d1c95e6e78295849fee807ba5691b Modified Files -- doc/src/sgml/catalogs.sgml | 2 +- doc/src/sgml/config.sgml| 4 ++-- doc/src/sgml/dblink.sgml| 8 doc/src/sgml/func.sgml | 2 +- doc/src/sgml/gin.sgml | 4 ++-- doc/src/sgml/high-availability.sgml | 2 +- doc/src/sgml/isn.sgml | 2 +- doc/src/sgml/mvcc.sgml | 2 +- doc/src/sgml/parallel.sgml | 2 +- doc/src/sgml/plpgsql.sgml | 8 doc/src/sgml/ref/select.sgml| 2 +- doc/src/sgml/ref/select_into.sgml | 2 +- doc/src/sgml/rules.sgml | 6 +++--- doc/src/sgml/seg.sgml | 4 ++-- doc/src/sgml/textsearch.sgml| 30 +++--- 15 files changed, 40 insertions(+), 40 deletions(-)
pgsql: Misc documentation fixes.
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 talked about "..." and ".." operators more clear, by avoiding to end the sentence with "..". That makes it look the same as "..." - Fix syntax description for HAVING: HAVING conditions cannot be repeated Patch by Justin Pryzby, per Yaroslav Schekin's report. Backpatch to all supported versions, to the extent that the patch applies easily. Discussion: https://www.postgresql.org/message-id/20201005191922.GE17626%40telsasoft.com Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/c5f42daa6077a4c309c5280a47d0e114c12dc572 Modified Files -- doc/src/sgml/catalogs.sgml | 2 +- doc/src/sgml/config.sgml| 4 ++-- doc/src/sgml/dblink.sgml| 8 doc/src/sgml/func.sgml | 32 doc/src/sgml/gin.sgml | 2 +- doc/src/sgml/high-availability.sgml | 2 +- doc/src/sgml/hstore.sgml| 10 +- doc/src/sgml/indexam.sgml | 2 +- doc/src/sgml/isn.sgml | 2 +- doc/src/sgml/ltree.sgml | 12 ++-- doc/src/sgml/mvcc.sgml | 2 +- doc/src/sgml/parallel.sgml | 2 +- doc/src/sgml/plpgsql.sgml | 12 ++-- doc/src/sgml/protocol.sgml | 2 +- doc/src/sgml/ref/select.sgml| 2 +- doc/src/sgml/ref/select_into.sgml | 2 +- doc/src/sgml/rules.sgml | 6 +++--- doc/src/sgml/seg.sgml | 4 ++-- doc/src/sgml/textsearch.sgml| 30 +++--- 19 files changed, 69 insertions(+), 69 deletions(-)
pgsql: Misc documentation fixes.
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 talked about "..." and ".." operators more clear, by avoiding to end the sentence with "..". That makes it look the same as "..." - Fix syntax description for HAVING: HAVING conditions cannot be repeated Patch by Justin Pryzby, per Yaroslav Schekin's report. Backpatch to all supported versions, to the extent that the patch applies easily. Discussion: https://www.postgresql.org/message-id/20201005191922.GE17626%40telsasoft.com Branch -- REL_11_STABLE Details --- https://git.postgresql.org/pg/commitdiff/1e17fb93571926ec225587abbb7eb11e4523c175 Modified Files -- doc/src/sgml/catalogs.sgml | 2 +- doc/src/sgml/config.sgml| 4 ++-- doc/src/sgml/dblink.sgml| 8 doc/src/sgml/func.sgml | 2 +- doc/src/sgml/gin.sgml | 2 +- doc/src/sgml/high-availability.sgml | 2 +- doc/src/sgml/indexam.sgml | 2 +- doc/src/sgml/isn.sgml | 2 +- doc/src/sgml/mvcc.sgml | 2 +- doc/src/sgml/parallel.sgml | 2 +- doc/src/sgml/plpgsql.sgml | 12 ++-- doc/src/sgml/protocol.sgml | 2 +- doc/src/sgml/ref/select.sgml| 2 +- doc/src/sgml/ref/select_into.sgml | 2 +- doc/src/sgml/rules.sgml | 6 +++--- doc/src/sgml/seg.sgml | 4 ++-- doc/src/sgml/textsearch.sgml| 30 +++--- 17 files changed, 43 insertions(+), 43 deletions(-)
pgsql: Fix list-munging bug that broke SQL function result coercions.
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 output in-place wouldn't be safe. However, it appears that the latter case has never actually worked, because the code tried to inject the new Query back into the query list it was passed ... which is not the list that will be used for later processing when we execute the SQL function "normally" (without inlining it). So we ended up with no coercion happening at run-time, leading to wrong results or crashes depending on the datatypes involved. While the regression tests look like they cover this area well enough, through a huge bit of bad luck all the test cases that exercise the separate-Query path were checking either inline-able cases (which accidentally didn't have the bug) or cases that are no-ops at runtime (e.g., varchar to text), so that the failure to perform the coercion wasn't obvious. The fact that the cases that don't work weren't allowed at all before v13 probably contributed to not noticing the problem sooner, too. To fix, get rid of the separate "flat" list of Query nodes and instead pass the real two-level list that is going to be used later. I chose to make the same change in check_sql_fn_statements(), although that has no actual bug, just so that we don't need that data structure at all. This is an API change, as evidenced by the adjustments needed to callers outside functions.c. That's a bit scary to be doing in a released branch, but so far as I can tell from a quick search, there are no outside callers of these functions (and they are sufficiently specific to our semantics for SQL-language functions that it's not apparent why any extension would need to call them). In any case, v13 already changed the API of check_sql_fn_retval() compared to prior branches. Per report from pinker. Back-patch to v13 where this code came in. Discussion: https://postgr.es/m/[email protected] Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/c8ab9701791e22f7a8e1badf362654db179c9703 Modified Files -- src/backend/catalog/pg_proc.c| 4 +- src/backend/executor/functions.c | 122 +-- src/backend/optimizer/util/clauses.c | 7 +- src/include/executor/functions.h | 4 +- src/test/regress/expected/rangefuncs.out | 44 +++ src/test/regress/sql/rangefuncs.sql | 11 +++ 6 files changed, 132 insertions(+), 60 deletions(-)
pgsql: Fix list-munging bug that broke SQL function result coercions.
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 output in-place wouldn't be safe. However, it appears that the latter case has never actually worked, because the code tried to inject the new Query back into the query list it was passed ... which is not the list that will be used for later processing when we execute the SQL function "normally" (without inlining it). So we ended up with no coercion happening at run-time, leading to wrong results or crashes depending on the datatypes involved. While the regression tests look like they cover this area well enough, through a huge bit of bad luck all the test cases that exercise the separate-Query path were checking either inline-able cases (which accidentally didn't have the bug) or cases that are no-ops at runtime (e.g., varchar to text), so that the failure to perform the coercion wasn't obvious. The fact that the cases that don't work weren't allowed at all before v13 probably contributed to not noticing the problem sooner, too. To fix, get rid of the separate "flat" list of Query nodes and instead pass the real two-level list that is going to be used later. I chose to make the same change in check_sql_fn_statements(), although that has no actual bug, just so that we don't need that data structure at all. This is an API change, as evidenced by the adjustments needed to callers outside functions.c. That's a bit scary to be doing in a released branch, but so far as I can tell from a quick search, there are no outside callers of these functions (and they are sufficiently specific to our semantics for SQL-language functions that it's not apparent why any extension would need to call them). In any case, v13 already changed the API of check_sql_fn_retval() compared to prior branches. Per report from pinker. Back-patch to v13 where this code came in. Discussion: https://postgr.es/m/[email protected] Branch -- REL_13_STABLE Details --- https://git.postgresql.org/pg/commitdiff/25378db74fd97f2b10ad44d1f0b2e1f8b0a651f2 Modified Files -- src/backend/catalog/pg_proc.c| 4 +- src/backend/executor/functions.c | 122 +-- src/backend/optimizer/util/clauses.c | 7 +- src/include/executor/functions.h | 4 +- src/test/regress/expected/rangefuncs.out | 44 +++ src/test/regress/sql/rangefuncs.sql | 11 +++ 6 files changed, 132 insertions(+), 60 deletions(-)
pgsql: Fix connection string handling in src/bin/scripts/ programs.
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 long time, though we failed to document that before this patch), we'd lose any other options it might specify, for example SSL or GSS parameters, possibly resulting in failure to connect. Thus, this is the same bug as commit a45bc8a4f fixed in pg_dump and pg_restore. We can fix it in the same way, by using libpq's rules for handling multiple "dbname" parameters to add the target database name separately. I chose to apply the same refactoring approach as in that patch, with a struct to handle the command line parameters that need to be passed through to connectDatabase. (Maybe someday we can unify the very similar functions here and in pg_dump/pg_restore.) Per Peter Eisentraut's comments on bug #16604. Back-patch to all supported branches. Discussion: https://postgr.es/m/[email protected] Branch -- REL9_5_STABLE Details --- https://git.postgresql.org/pg/commitdiff/da129a04a6dea8c30eec2477c08d17736c92d431 Modified Files -- doc/src/sgml/ref/clusterdb.sgml | 20 + doc/src/sgml/ref/createdb.sgml | 3 ++ doc/src/sgml/ref/dropdb.sgml| 3 ++ doc/src/sgml/ref/reindexdb.sgml | 20 + doc/src/sgml/ref/vacuumdb.sgml | 20 + src/bin/scripts/clusterdb.c | 67 ++- src/bin/scripts/common.c| 89 - src/bin/scripts/common.h| 26 src/bin/scripts/createdb.c | 11 - src/bin/scripts/createlang.c| 12 +- src/bin/scripts/createuser.c| 11 - src/bin/scripts/dropdb.c| 12 -- src/bin/scripts/droplang.c | 12 +- src/bin/scripts/dropuser.c | 13 -- src/bin/scripts/reindexdb.c | 85 +++ src/bin/scripts/vacuumdb.c | 70 ++-- 16 files changed, 274 insertions(+), 200 deletions(-)
pgsql: Fix connection string handling in src/bin/scripts/ programs.
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 long time, though we failed to document that before this patch), we'd lose any other options it might specify, for example SSL or GSS parameters, possibly resulting in failure to connect. Thus, this is the same bug as commit a45bc8a4f fixed in pg_dump and pg_restore. We can fix it in the same way, by using libpq's rules for handling multiple "dbname" parameters to add the target database name separately. I chose to apply the same refactoring approach as in that patch, with a struct to handle the command line parameters that need to be passed through to connectDatabase. (Maybe someday we can unify the very similar functions here and in pg_dump/pg_restore.) Per Peter Eisentraut's comments on bug #16604. Back-patch to all supported branches. Discussion: https://postgr.es/m/[email protected] Branch -- REL_11_STABLE Details --- https://git.postgresql.org/pg/commitdiff/5a9f99bed8cbd4a2aafaedbf464eedf9ae9e73a8 Modified Files -- doc/src/sgml/ref/clusterdb.sgml | 20 + doc/src/sgml/ref/createdb.sgml | 3 ++ doc/src/sgml/ref/dropdb.sgml| 3 ++ doc/src/sgml/ref/reindexdb.sgml | 20 + doc/src/sgml/ref/vacuumdb.sgml | 20 + src/bin/scripts/clusterdb.c | 67 ++- src/bin/scripts/common.c| 89 - src/bin/scripts/common.h| 26 src/bin/scripts/createdb.c | 11 - src/bin/scripts/createuser.c| 11 - src/bin/scripts/dropdb.c| 12 -- src/bin/scripts/dropuser.c | 13 -- src/bin/scripts/reindexdb.c | 85 +++ src/bin/scripts/vacuumdb.c | 70 ++-- 14 files changed, 254 insertions(+), 196 deletions(-)
pgsql: Fix connection string handling in src/bin/scripts/ programs.
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 long time, though we failed to document that before this patch), we'd lose any other options it might specify, for example SSL or GSS parameters, possibly resulting in failure to connect. Thus, this is the same bug as commit a45bc8a4f fixed in pg_dump and pg_restore. We can fix it in the same way, by using libpq's rules for handling multiple "dbname" parameters to add the target database name separately. I chose to apply the same refactoring approach as in that patch, with a struct to handle the command line parameters that need to be passed through to connectDatabase. (Maybe someday we can unify the very similar functions here and in pg_dump/pg_restore.) Per Peter Eisentraut's comments on bug #16604. Back-patch to all supported branches. Discussion: https://postgr.es/m/[email protected] Branch -- REL_12_STABLE Details --- https://git.postgresql.org/pg/commitdiff/c6d0b9b1668cde5f13e632bad813bd9d666caf9b Modified Files -- doc/src/sgml/ref/clusterdb.sgml | 20 + doc/src/sgml/ref/createdb.sgml | 3 ++ doc/src/sgml/ref/dropdb.sgml| 3 ++ doc/src/sgml/ref/reindexdb.sgml | 20 + doc/src/sgml/ref/vacuumdb.sgml | 20 + src/bin/scripts/clusterdb.c | 67 ++- src/bin/scripts/common.c| 89 - src/bin/scripts/common.h| 26 src/bin/scripts/createdb.c | 11 - src/bin/scripts/createuser.c| 11 - src/bin/scripts/dropdb.c| 12 -- src/bin/scripts/dropuser.c | 13 -- src/bin/scripts/reindexdb.c | 85 +++ src/bin/scripts/vacuumdb.c | 70 ++-- 14 files changed, 254 insertions(+), 196 deletions(-)
pgsql: Fix connection string handling in src/bin/scripts/ programs.
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 long time, though we failed to document that before this patch), we'd lose any other options it might specify, for example SSL or GSS parameters, possibly resulting in failure to connect. Thus, this is the same bug as commit a45bc8a4f fixed in pg_dump and pg_restore. We can fix it in the same way, by using libpq's rules for handling multiple "dbname" parameters to add the target database name separately. I chose to apply the same refactoring approach as in that patch, with a struct to handle the command line parameters that need to be passed through to connectDatabase. (Maybe someday we can unify the very similar functions here and in pg_dump/pg_restore.) Per Peter Eisentraut's comments on bug #16604. Back-patch to all supported branches. Discussion: https://postgr.es/m/[email protected] Branch -- REL_13_STABLE Details --- https://git.postgresql.org/pg/commitdiff/1814f915b526d5022b3e2a6ce4ea3bcbe59abe2c Modified Files -- doc/src/sgml/ref/clusterdb.sgml| 20 ++--- doc/src/sgml/ref/createdb.sgml | 3 ++ doc/src/sgml/ref/dropdb.sgml | 3 ++ doc/src/sgml/ref/reindexdb.sgml| 20 ++--- doc/src/sgml/ref/vacuumdb.sgml | 20 ++--- src/bin/scripts/clusterdb.c| 67 +--- src/bin/scripts/common.c | 89 +++--- src/bin/scripts/common.h | 26 --- src/bin/scripts/createdb.c | 11 - src/bin/scripts/createuser.c | 11 - src/bin/scripts/dropdb.c | 12 +++-- src/bin/scripts/dropuser.c | 13 -- src/bin/scripts/reindexdb.c| 89 ++ src/bin/scripts/scripts_parallel.c | 6 +-- src/bin/scripts/scripts_parallel.h | 6 +-- src/bin/scripts/vacuumdb.c | 70 +- 16 files changed, 260 insertions(+), 206 deletions(-)
pgsql: Fix connection string handling in src/bin/scripts/ programs.
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 long time, though we failed to document that before this patch), we'd lose any other options it might specify, for example SSL or GSS parameters, possibly resulting in failure to connect. Thus, this is the same bug as commit a45bc8a4f fixed in pg_dump and pg_restore. We can fix it in the same way, by using libpq's rules for handling multiple "dbname" parameters to add the target database name separately. I chose to apply the same refactoring approach as in that patch, with a struct to handle the command line parameters that need to be passed through to connectDatabase. (Maybe someday we can unify the very similar functions here and in pg_dump/pg_restore.) Per Peter Eisentraut's comments on bug #16604. Back-patch to all supported branches. Discussion: https://postgr.es/m/[email protected] Branch -- REL9_6_STABLE Details --- https://git.postgresql.org/pg/commitdiff/5c78f797701b90546279b994791fc07af5bbb5c9 Modified Files -- doc/src/sgml/ref/clusterdb.sgml | 20 + doc/src/sgml/ref/createdb.sgml | 3 ++ doc/src/sgml/ref/dropdb.sgml| 3 ++ doc/src/sgml/ref/reindexdb.sgml | 20 + doc/src/sgml/ref/vacuumdb.sgml | 20 + src/bin/scripts/clusterdb.c | 67 ++- src/bin/scripts/common.c| 89 - src/bin/scripts/common.h| 26 src/bin/scripts/createdb.c | 11 - src/bin/scripts/createlang.c| 12 +- src/bin/scripts/createuser.c| 11 - src/bin/scripts/dropdb.c| 12 -- src/bin/scripts/droplang.c | 12 +- src/bin/scripts/dropuser.c | 13 -- src/bin/scripts/reindexdb.c | 85 +++ src/bin/scripts/vacuumdb.c | 70 ++-- 16 files changed, 274 insertions(+), 200 deletions(-)
pgsql: Fix connection string handling in src/bin/scripts/ programs.
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 long time, though we failed to document that before this patch), we'd lose any other options it might specify, for example SSL or GSS parameters, possibly resulting in failure to connect. Thus, this is the same bug as commit a45bc8a4f fixed in pg_dump and pg_restore. We can fix it in the same way, by using libpq's rules for handling multiple "dbname" parameters to add the target database name separately. I chose to apply the same refactoring approach as in that patch, with a struct to handle the command line parameters that need to be passed through to connectDatabase. (Maybe someday we can unify the very similar functions here and in pg_dump/pg_restore.) Per Peter Eisentraut's comments on bug #16604. Back-patch to all supported branches. Discussion: https://postgr.es/m/[email protected] Branch -- REL_10_STABLE Details --- https://git.postgresql.org/pg/commitdiff/68f2369930f923df79fef4c62843a40baa1facec Modified Files -- doc/src/sgml/ref/clusterdb.sgml | 20 + doc/src/sgml/ref/createdb.sgml | 3 ++ doc/src/sgml/ref/dropdb.sgml| 3 ++ doc/src/sgml/ref/reindexdb.sgml | 20 + doc/src/sgml/ref/vacuumdb.sgml | 20 + src/bin/scripts/clusterdb.c | 67 ++- src/bin/scripts/common.c| 89 - src/bin/scripts/common.h| 26 src/bin/scripts/createdb.c | 11 - src/bin/scripts/createuser.c| 11 - src/bin/scripts/dropdb.c| 12 -- src/bin/scripts/dropuser.c | 13 -- src/bin/scripts/reindexdb.c | 85 +++ src/bin/scripts/vacuumdb.c | 70 ++-- 14 files changed, 254 insertions(+), 196 deletions(-)
pgsql: Fix connection string handling in src/bin/scripts/ programs.
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 long time, though we failed to document that before this patch), we'd lose any other options it might specify, for example SSL or GSS parameters, possibly resulting in failure to connect. Thus, this is the same bug as commit a45bc8a4f fixed in pg_dump and pg_restore. We can fix it in the same way, by using libpq's rules for handling multiple "dbname" parameters to add the target database name separately. I chose to apply the same refactoring approach as in that patch, with a struct to handle the command line parameters that need to be passed through to connectDatabase. (Maybe someday we can unify the very similar functions here and in pg_dump/pg_restore.) Per Peter Eisentraut's comments on bug #16604. Back-patch to all supported branches. Discussion: https://postgr.es/m/[email protected] Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/8e5793ab60bba65ffaa0f2237b39c9580d8972c7 Modified Files -- doc/src/sgml/ref/clusterdb.sgml| 20 ++--- doc/src/sgml/ref/createdb.sgml | 3 ++ doc/src/sgml/ref/dropdb.sgml | 3 ++ doc/src/sgml/ref/reindexdb.sgml| 20 ++--- doc/src/sgml/ref/vacuumdb.sgml | 20 ++--- src/bin/scripts/clusterdb.c| 67 +--- src/bin/scripts/common.c | 89 +++--- src/bin/scripts/common.h | 26 --- src/bin/scripts/createdb.c | 11 - src/bin/scripts/createuser.c | 11 - src/bin/scripts/dropdb.c | 12 +++-- src/bin/scripts/dropuser.c | 13 -- src/bin/scripts/reindexdb.c| 89 ++ src/bin/scripts/scripts_parallel.c | 6 +-- src/bin/scripts/scripts_parallel.h | 6 +-- src/bin/scripts/vacuumdb.c | 70 +- 16 files changed, 260 insertions(+), 206 deletions(-)
Re: pgsql: Change the docs for PARALLEL option of Vacuum.
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.
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...@mail.gmail.com Branch -- REL_13_STABLE Details --- https://git.postgresql.org/pg/commitdiff/0a1377760bcdfe837ea5f602a800ea97c668bf16 Modified Files -- doc/src/sgml/ref/vacuum.sgml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
pgsql: Change the attribute name in pg_stat_replication_slots view.
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, fix the typo in one of the macros in the related code. Bump the catversion as we have modified the name in the catalog as well. Reported-by: Noriyoshi Shinoda Author: Noriyoshi Shinoda Reviewed-by: Sawada Masahiko and Amit Kapila Discussion: https://postgr.es/m/ca+fd4k5_ppayrtdro2pbttoe0ehqpbvuqmcr8ic39utnmr4...@mail.gmail.com Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/03d51b776d88badbeb4452c1ab452feb78dce36a Modified Files -- contrib/test_decoding/expected/stats.out | 14 +++--- contrib/test_decoding/sql/stats.sql | 8 doc/src/sgml/monitoring.sgml | 2 +- src/backend/catalog/system_views.sql | 2 +- src/backend/utils/adt/pgstatfuncs.c | 6 +++--- src/include/catalog/catversion.h | 2 +- src/include/catalog/pg_proc.dat | 2 +- src/test/regress/expected/rules.out | 4 ++-- 8 files changed, 20 insertions(+), 20 deletions(-)
