pgsql: Remove incorrect assertion for INSERT in logical replication's p

2020-01-12 Thread Michael Paquier
Remove incorrect assertion for INSERT in logical replication's publisher On the publisher, it was assumed that an INSERT change cannot happen for a relation with no replica identity. However this is true only for a change that needs references to old rows, aka UPDATE or DELETE, so trying to use l

pgsql: Remove incorrect assertion for INSERT in logical replication's p

2020-01-12 Thread Michael Paquier
Remove incorrect assertion for INSERT in logical replication's publisher On the publisher, it was assumed that an INSERT change cannot happen for a relation with no replica identity. However this is true only for a change that needs references to old rows, aka UPDATE or DELETE, so trying to use l

pgsql: Remove incorrect assertion for INSERT in logical replication's p

2020-01-12 Thread Michael Paquier
Remove incorrect assertion for INSERT in logical replication's publisher On the publisher, it was assumed that an INSERT change cannot happen for a relation with no replica identity. However this is true only for a change that needs references to old rows, aka UPDATE or DELETE, so trying to use l

pgsql: Remove incorrect assertion for INSERT in logical replication's p

2020-01-12 Thread Michael Paquier
Remove incorrect assertion for INSERT in logical replication's publisher On the publisher, it was assumed that an INSERT change cannot happen for a relation with no replica identity. However this is true only for a change that needs references to old rows, aka UPDATE or DELETE, so trying to use l

pgsql: Fix edge-case crashes and misestimation in range containment sel

2020-01-12 Thread Tom Lane
Fix edge-case crashes and misestimation in range containment selectivity. When estimating the selectivity of "range_var <@ range_constant" or "range_var @> range_constant", if the upper (or respectively lower) bound of the range_constant was above the last bin of the range_var's histogram, the cod

pgsql: Fix edge-case crashes and misestimation in range containment sel

2020-01-12 Thread Tom Lane
Fix edge-case crashes and misestimation in range containment selectivity. When estimating the selectivity of "range_var <@ range_constant" or "range_var @> range_constant", if the upper (or respectively lower) bound of the range_constant was above the last bin of the range_var's histogram, the cod

pgsql: Fix edge-case crashes and misestimation in range containment sel

2020-01-12 Thread Tom Lane
Fix edge-case crashes and misestimation in range containment selectivity. When estimating the selectivity of "range_var <@ range_constant" or "range_var @> range_constant", if the upper (or respectively lower) bound of the range_constant was above the last bin of the range_var's histogram, the cod

pgsql: Fix edge-case crashes and misestimation in range containment sel

2020-01-12 Thread Tom Lane
Fix edge-case crashes and misestimation in range containment selectivity. When estimating the selectivity of "range_var <@ range_constant" or "range_var @> range_constant", if the upper (or respectively lower) bound of the range_constant was above the last bin of the range_var's histogram, the cod

pgsql: Fix edge-case crashes and misestimation in range containment sel

2020-01-12 Thread Tom Lane
Fix edge-case crashes and misestimation in range containment selectivity. When estimating the selectivity of "range_var <@ range_constant" or "range_var @> range_constant", if the upper (or respectively lower) bound of the range_constant was above the last bin of the range_var's histogram, the cod

pgsql: Fix edge-case crashes and misestimation in range containment sel

2020-01-12 Thread Tom Lane
Fix edge-case crashes and misestimation in range containment selectivity. When estimating the selectivity of "range_var <@ range_constant" or "range_var @> range_constant", if the upper (or respectively lower) bound of the range_constant was above the last bin of the range_var's histogram, the cod

pgsql: Fix edge-case crashes and misestimation in range containment sel

2020-01-12 Thread Tom Lane
Fix edge-case crashes and misestimation in range containment selectivity. When estimating the selectivity of "range_var <@ range_constant" or "range_var @> range_constant", if the upper (or respectively lower) bound of the range_constant was above the last bin of the range_var's histogram, the cod

pgsql: Apply all available functional dependencies

2020-01-12 Thread Tomas Vondra
Apply all available functional dependencies When considering functional dependencies during selectivity estimation, it's not necessary to bother with selecting the best extended statistic object and then use just dependencies from it. We can simply consider all applicable functional dependencies a

pgsql: Apply multiple multivariate MCV lists when possible

2020-01-12 Thread Tomas Vondra
Apply multiple multivariate MCV lists when possible Until now we've only used a single multivariate MCV list per relation, covering the largest number of clauses. So for example given a query SELECT * FROM t WHERE a = 1 AND b =1 AND c = 1 AND d = 1 and extended statistics on (a,b) and (c,d),

pgsql: Delete empty pages in each pass during GIST VACUUM.

2020-01-12 Thread Amit Kapila
Delete empty pages in each pass during GIST VACUUM. Earlier, we use to postpone deleting empty pages till the second stage of vacuum to amortize the cost of scanning internal pages. However, that can sometimes (say vacuum is canceled or errored between first and second stage) delay the pages to b

pgsql: Only superuser can set sslcert/sslkey in postgres_fdw user mappi

2020-01-12 Thread Andrew Dunstan
Only superuser can set sslcert/sslkey in postgres_fdw user mappings Othrwise there is a security risk. Discussion: https://postgr.es/m/20200109103014.ga4...@msg.df7cb.de Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/cebf9d6e6ee13cbf9f1a91ec633cf96780ffc985 Modif