Re: pgsql: Add tests for reinit.c

2018-03-19 Thread Andrew Dunstan
On Sat, Mar 17, 2018 at 12:06 AM, David Steele wrote: > On 3/15/18 11:51 PM, Tom Lane wrote: > > I wrote: > >> Peter Eisentraut writes: > >>> Add tests for reinit.c > > > >> BTW, buildfarm member jacana hasn't succeeded at this test once. > >> The failures look like > > > >> ok 1 - init fork in

pgsql: Fix typo in comment

2018-03-19 Thread Magnus Hagander
Fix typo in comment Author: Daniel Gustafsson Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/71cce90ee99098f52e65278b96662e32ca005771 Modified Files -- src/backend/libpq/be-secure-openssl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

Re: pgsql: Add tests for reinit.c

2018-03-19 Thread David Steele
On 3/19/18 4:15 AM, Andrew Dunstan wrote: > > The attached fixes it. We should probably put the function or something > like it in TestLib.pm, though. The call to pwd is quite tricky - it > needs to be done pretty much exactly like this, not quite sure why, but > direct calls to "pwd -W" via syste

pgsql: Rewrite recurse_union_children to iterate, rather than recurse.

2018-03-19 Thread Robert Haas
Rewrite recurse_union_children to iterate, rather than recurse. Also, rename it to plan_union_chidren, so the old name wasn't very descriptive. This results in a small net reduction in code, seems at least to me to be easier to understand, and saves space on the process stack. Patch by me, revie

pgsql: Generate a separate upper relation for each stage of setop plann

2018-03-19 Thread Robert Haas
Generate a separate upper relation for each stage of setop planning. Commit 3fc6e2d7f5b652b417fa6937c34de2438d60fa9f made setop planning stages return paths rather than plans, but all such paths were loosely associated with a single RelOptInfo, and only the final path was added to the RelOptInfo.

pgsql: Fix state reversal after partition tuple routing

2018-03-19 Thread Alvaro Herrera
Fix state reversal after partition tuple routing We make some changes to ModifyTableState and the EState it uses whenever we route tuples to partitions; but we weren't restoring properly in all cases, possibly causing crashes when partitions with different tuple descriptors are targeted by tuples

pgsql: Fix state reversal after partition tuple routing

2018-03-19 Thread Alvaro Herrera
Fix state reversal after partition tuple routing We make some changes to ModifyTableState and the EState it uses whenever we route tuples to partitions; but we weren't restoring properly in all cases, possibly causing crashes when partitions with different tuple descriptors are targeted by tuples

pgsql: Expand comment a little bit

2018-03-19 Thread Alvaro Herrera
Expand comment a little bit The previous commit removed a comment that was a bit more verbose than its replacement. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/839a8eb2b3df68e105fb4f7a72e71652d6becc7a Modified Files -- src/backend/executor/nodeModif

pgsql: Remove unnecessary members from ModifyTableState and ExecInsert

2018-03-19 Thread Alvaro Herrera
Remove unnecessary members from ModifyTableState and ExecInsert These values can be obtained from the ModifyTable node which is already a part of both the ModifyTableState and ExecInsert. Author: Álvaro Herrera, Amit Langote Reviewed-by: Peter Geoghegan Discussion: https://postgr.es/m/20180316151

pgsql: Fix performance hazard in REFRESH MATERIALIZED VIEW CONCURRENTLY

2018-03-19 Thread Tom Lane
Fix performance hazard in REFRESH MATERIALIZED VIEW CONCURRENTLY. Jeff Janes discovered that commit 7ca25b7de made one of the queries run by REFRESH MATERIALIZED VIEW CONCURRENTLY perform badly. The root cause is bad cardinality estimation for correlated quals, but a principled solution to that p

pgsql: Fix performance hazard in REFRESH MATERIALIZED VIEW CONCURRENTLY

2018-03-19 Thread Tom Lane
Fix performance hazard in REFRESH MATERIALIZED VIEW CONCURRENTLY. Jeff Janes discovered that commit 7ca25b7de made one of the queries run by REFRESH MATERIALIZED VIEW CONCURRENTLY perform badly. The root cause is bad cardinality estimation for correlated quals, but a principled solution to that p

pgsql: Fix performance hazard in REFRESH MATERIALIZED VIEW CONCURRENTLY

2018-03-19 Thread Tom Lane
Fix performance hazard in REFRESH MATERIALIZED VIEW CONCURRENTLY. Jeff Janes discovered that commit 7ca25b7de made one of the queries run by REFRESH MATERIALIZED VIEW CONCURRENTLY perform badly. The root cause is bad cardinality estimation for correlated quals, but a principled solution to that p

pgsql: Fix performance hazard in REFRESH MATERIALIZED VIEW CONCURRENTLY

2018-03-19 Thread Tom Lane
Fix performance hazard in REFRESH MATERIALIZED VIEW CONCURRENTLY. Jeff Janes discovered that commit 7ca25b7de made one of the queries run by REFRESH MATERIALIZED VIEW CONCURRENTLY perform badly. The root cause is bad cardinality estimation for correlated quals, but a principled solution to that p

pgsql: Fix performance hazard in REFRESH MATERIALIZED VIEW CONCURRENTLY

2018-03-19 Thread Tom Lane
Fix performance hazard in REFRESH MATERIALIZED VIEW CONCURRENTLY. Jeff Janes discovered that commit 7ca25b7de made one of the queries run by REFRESH MATERIALIZED VIEW CONCURRENTLY perform badly. The root cause is bad cardinality estimation for correlated quals, but a principled solution to that p

pgsql: Don't use an Msys virtual path to create a tablespace

2018-03-19 Thread Andrew Dunstan
Don't use an Msys virtual path to create a tablespace The new unlogged_reinit recovery tests create a new tablespace using TestLib.pm's tempdir. However, on msys that function returns a virtual path that isn't understood by Postgres. Here we add a new function to TestLib.pm to turn such a path int

Re: pgsql: Add tests for reinit.c

2018-03-19 Thread Andrew Dunstan
On Mon, Mar 19, 2018 at 11:33 PM, David Steele wrote: > On 3/19/18 4:15 AM, Andrew Dunstan wrote: >> >> The attached fixes it. We should probably put the function or something >> like it in TestLib.pm, though. The call to pwd is quite tricky - it >> needs to be done pretty much exactly like this,

pgsql: Fix some corner-case issues in REFRESH MATERIALIZED VIEW CONCURR

2018-03-19 Thread Tom Lane
Fix some corner-case issues in REFRESH MATERIALIZED VIEW CONCURRENTLY. refresh_by_match_merge() has some issues in the way it builds a SQL query to construct the "diff" table: 1. It doesn't require the selected unique index(es) to be indimmediate. 2. It doesn't pay attention to the particular equ

pgsql: Fix some corner-case issues in REFRESH MATERIALIZED VIEW CONCURR

2018-03-19 Thread Tom Lane
Fix some corner-case issues in REFRESH MATERIALIZED VIEW CONCURRENTLY. refresh_by_match_merge() has some issues in the way it builds a SQL query to construct the "diff" table: 1. It doesn't require the selected unique index(es) to be indimmediate. 2. It doesn't pay attention to the particular equ

pgsql: Fix some corner-case issues in REFRESH MATERIALIZED VIEW CONCURR

2018-03-19 Thread Tom Lane
Fix some corner-case issues in REFRESH MATERIALIZED VIEW CONCURRENTLY. refresh_by_match_merge() has some issues in the way it builds a SQL query to construct the "diff" table: 1. It doesn't require the selected unique index(es) to be indimmediate. 2. It doesn't pay attention to the particular equ

pgsql: Fix some corner-case issues in REFRESH MATERIALIZED VIEW CONCURR

2018-03-19 Thread Tom Lane
Fix some corner-case issues in REFRESH MATERIALIZED VIEW CONCURRENTLY. refresh_by_match_merge() has some issues in the way it builds a SQL query to construct the "diff" table: 1. It doesn't require the selected unique index(es) to be indimmediate. 2. It doesn't pay attention to the particular equ

pgsql: Fix some corner-case issues in REFRESH MATERIALIZED VIEW CONCURR

2018-03-19 Thread Tom Lane
Fix some corner-case issues in REFRESH MATERIALIZED VIEW CONCURRENTLY. refresh_by_match_merge() has some issues in the way it builds a SQL query to construct the "diff" table: 1. It doesn't require the selected unique index(es) to be indimmediate. 2. It doesn't pay attention to the particular equ

pgsql: Add missing break

2018-03-19 Thread Peter Eisentraut
Add missing break Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/13c7c65ec900a30bcddcb27f5fd138dcdbc2ca2e Modified Files -- src/backend/parser/analyze.c | 1 + 1 file changed, 1 insertion(+)

Re: pgsql: Set libpq sslcompression to off by default

2018-03-19 Thread Peter Eisentraut
On 3/17/18 15:12, Daniel Gustafsson wrote: >> On 17 Mar 2018, at 17:47, Tom Lane wrote: >> >> Peter Eisentraut writes: >>> Set libpq sslcompression to off by default >> >> Buildfarm reports that SSL_clear_options isn't available everywhere. > > Per some reading of the documentation and various p

Re: pgsql: Add tests for reinit.c

2018-03-19 Thread David Steele
On 3/19/18 5:58 PM, Andrew Dunstan wrote: > On Mon, Mar 19, 2018 at 11:33 PM, David Steele wrote: >> On 3/19/18 4:15 AM, Andrew Dunstan wrote: >>> >>> The attached fixes it. We should probably put the function or something >>> like it in TestLib.pm, though. The call to pwd is quite tricky - it >>>

pgsql: Prevent query-lifespan memory leakage of SP-GiST traversal value

2018-03-19 Thread Tom Lane
Prevent query-lifespan memory leakage of SP-GiST traversal values. The original coding of the SP-GiST scan traversalValue feature (commit ccd6eb49a) arranged for traversal values to be stored in the query's main executor context. That's fine if there's only one index scan per query, but if there

pgsql: Prevent query-lifespan memory leakage of SP-GiST traversal value

2018-03-19 Thread Tom Lane
Prevent query-lifespan memory leakage of SP-GiST traversal values. The original coding of the SP-GiST scan traversalValue feature (commit ccd6eb49a) arranged for traversal values to be stored in the query's main executor context. That's fine if there's only one index scan per query, but if there

pgsql: Prevent query-lifespan memory leakage of SP-GiST traversal value

2018-03-19 Thread Tom Lane
Prevent query-lifespan memory leakage of SP-GiST traversal values. The original coding of the SP-GiST scan traversalValue feature (commit ccd6eb49a) arranged for traversal values to be stored in the query's main executor context. That's fine if there's only one index scan per query, but if there

Re: pgsql: Set libpq sslcompression to off by default

2018-03-19 Thread Tom Lane
Peter Eisentraut writes: > On 3/17/18 15:12, Daniel Gustafsson wrote: >> On 17 Mar 2018, at 17:47, Tom Lane wrote: >>> Buildfarm reports that SSL_clear_options isn't available everywhere. >> Per some reading of the documentation and various patchers it seems >> SSL_clear_options() was introduced