PostgreSQL Bugs

Collected from the PG bugs email list.

Bug ID16534
PG Version12.3
OSWindows 10 x64 / Ubuntun 20.04 x64
Opened2020-07-10 14:00:42+00
Reported byMartin Winkel
StatusNew

Body of first available message related to this bug follows.

The following bug has been logged on the website:

Bug reference:      16534
Logged by:          Martin Winkel
Email address:      (redacted)
PostgreSQL version: 12.3
Operating system:   Windows 10 x64 / Ubuntun 20.04 x64
Description:        

I have indexes on on the latitude() and longitude() values of an
earth-column. I can analyze these tables, but autoanalyze fails. Because
autoanalyze fails, it will keep trying to analyze these tables.

I created a test-script. After this script, check the postgresql log, you
will find the error attachted below.

TEST SCRIPT:

CREATE EXTENSION cube;
CREATE EXTENSION earthdistance;
	
CREATE TABLE earthdisttest
(
    id serial NOT NULL,
    gps earth NOT NULL,
    PRIMARY KEY (id)
);
	
CREATE INDEX idx_earthtest
    ON earthdisttest USING btree
    (latitude(gps) NULLS LAST);
	
	
ALTER TABLE earthdisttest SET (autovacuum_vacuum_scale_factor = 0.0);
ALTER TABLE earthdisttest SET (autovacuum_vacuum_threshold = 3);
ALTER TABLE earthdisttest SET (autovacuum_analyze_scale_factor = 0.0);
ALTER TABLE earthdisttest SET (autovacuum_analyze_threshold = 3);

INSERT INTO earthdisttest (gps) VALUES (ll_to_earth(10,30)),
(ll_to_earth(1,59)), (ll_to_earth(43,12)), (ll_to_earth(-10,23));


ERROR

2020-07-10 15:59:17.464 CEST [39988] ERROR:  function
cube_ll_coord(public.earth, integer) does not exist at character 18
2020-07-10 15:59:17.464 CEST [39988] HINT:  No function matches the given
name and argument types. You might need to add explicit type casts.
2020-07-10 15:59:17.464 CEST [39988] QUERY:  SELECT CASE WHEN
cube_ll_coord($1, 3)/earth() < -1 THEN -90::float8 WHEN cube_ll_coord($1,
3)/earth() > 1 THEN 90::float8 ELSE degrees(asin(cube_ll_coord($1,
3)/earth())) END
2020-07-10 15:59:17.464 CEST [39988] CONTEXT:  SQL function "latitude"
during inlining
	automatic analyze of table "test.public.earthdisttest"

Messages

DateAuthorSubject
2020-07-10 14:00:42+00PG Bug reporting formBUG #16534: autovacuum_autoanalyze not working on latitude(earth) expression
2020-07-10 14:36:16+00Tom LaneRe: BUG #16534: autovacuum_autoanalyze not working on latitude(earth) expression
2020-07-10 19:58:05+00Sergei KornilovRe: BUG #16534: autovacuum_autoanalyze not working on latitude(earth) expression
2020-07-12 09:46:49+00Martin WinkelRe: BUG #16534: autovacuum_autoanalyze not working on latitude(earth) expression