Re: pgsql: Fix confusion in SP-GiST between attribute type and leaf storage

2021-04-04 Thread Tom Lane
Michael Paquier writes: > On Sun, Apr 04, 2021 at 06:29:09PM +, Tom Lane wrote: >> Fix confusion in SP-GiST between attribute type and leaf storage type. > anole, woodstar and some other animals have been failing after this > commit: > https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=a

Re: pgsql: Fix confusion in SP-GiST between attribute type and leaf storage

2021-04-04 Thread Michael Paquier
On Sun, Apr 04, 2021 at 06:29:09PM +, Tom Lane wrote: > Fix confusion in SP-GiST between attribute type and leaf storage type. anole, woodstar and some other animals have been failing after this commit: https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=anole&dt=2021-04-04%2021%3A36%3A54

pgsql: Fix typo in collationcmds.c

2021-04-04 Thread Michael Paquier
Fix typo in collationcmds.c Introduced by 51e225d. Author: Anton Voloshin Discussion: https://postgr.es/m/[email protected] Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/9f6f1f9b8e61f9ce47e1936fc68c21a4a8d6722c Modified Files -

pgsql: Refactor all TAP test suites doing connection checks

2021-04-04 Thread Michael Paquier
Refactor all TAP test suites doing connection checks This commit refactors more TAP tests to adapt with the recent introduction of connect_ok() and connect_fails() in PostgresNode, introduced by 0d1a3343. This changes the following test suites to use the same code paths for connection checks: - K

pgsql: Fix more confusion in SP-GiST.

2021-04-04 Thread Tom Lane
Fix more confusion in SP-GiST. spg_box_quad_leaf_consistent unconditionally returned the leaf datum as leafValue, even though in its usage for poly_ops that value is of completely the wrong type. In versions before 12, that was harmless because the core code did nothing with leafValue in non-inde

pgsql: Fix more confusion in SP-GiST.

2021-04-04 Thread Tom Lane
Fix more confusion in SP-GiST. spg_box_quad_leaf_consistent unconditionally returned the leaf datum as leafValue, even though in its usage for poly_ops that value is of completely the wrong type. In versions before 12, that was harmless because the core code did nothing with leafValue in non-inde

pgsql: Fix more confusion in SP-GiST.

2021-04-04 Thread Tom Lane
Fix more confusion in SP-GiST. spg_box_quad_leaf_consistent unconditionally returned the leaf datum as leafValue, even though in its usage for poly_ops that value is of completely the wrong type. In versions before 12, that was harmless because the core code did nothing with leafValue in non-inde

pgsql: Fix confusion in SP-GiST between attribute type and leaf storage

2021-04-04 Thread Tom Lane
Fix confusion in SP-GiST between attribute type and leaf storage type. According to the documentation, the attType passed to the opclass config function (and also relied on by the core code) is the type of the heap column or expression being indexed. But what was actually being passed was the typ

pgsql: Fix bug in brin_minmax_multi_union

2021-04-04 Thread Tomas Vondra
Fix bug in brin_minmax_multi_union When calling sort_expanded_ranges() we need to remember the return value, because the function sorts and also deduplicates the ranges. So the number of ranges may decrease. brin_minmax_multi_union failed to do that, which resulted in crashes due to bogus ranges (

pgsql: Add regression test for minmax-multi macaddr8 type

2021-04-04 Thread Tomas Vondra
Add regression test for minmax-multi macaddr8 type The regression test for BRIN minmax-multi opclasses tested almost all supported data types, with the exception of macaddr8. So this adds it. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/4908684ddab35135869efa2af6

pgsql: Fix order of parameters in BRIN minmax-multi calls

2021-04-04 Thread Tomas Vondra
Fix order of parameters in BRIN minmax-multi calls The BRIN minmax-multi consistent function incorrectly assumed it can lookup an operator, and then swap the arguments to get the commutator. For example <(a,b) would be called as <(b,a) to get >(a,b). This works when the arguments are of the same t

pgsql: Fix BRIN minmax-multi distance for inet type

2021-04-04 Thread Tomas Vondra
Fix BRIN minmax-multi distance for inet type The distance calculation ignored the mask, unlike the inet comparator, which resulted in negative distance in some cases. Fixed by applying the mask in brin_minmax_multi_distance_inet. I've considered simply calling inetmi() to calculate the delta, but

pgsql: Fix BRIN minmax-multi distance for timetz type

2021-04-04 Thread Tomas Vondra
Fix BRIN minmax-multi distance for timetz type The distance calculation ignored the time zone, so the result of (b-a) might have ended negative even if (b > a). Fixed by considering the time zone difference. Reported-by: Jaime Casanova Discussion: https://postgr.es/m/CAJKUy5jLZFLCxyxfT%3DMfK5mtP

pgsql: Fix BRIN minmax-multi distance for interval type

2021-04-04 Thread Tomas Vondra
Fix BRIN minmax-multi distance for interval type The distance calculation for interval type was treating months as having 31 days, which is inconsistent with the interval comparator (using 30 days). Due to this it was possible to get negative distance (b-a) when (ahttps://postgr.es/m/CAJKUy5jKH0Xh