Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#4291 closed defect (fixed)

[raster] Calling ST_Intersects in matviews causes unrestorable pg_dump

Reported by: nblumoe Owned by: robe
Priority: blocker Milestone: PostGIS 2.3.9
Component: raster Version: 2.4.x
Keywords: Cc:

Description

I am using materialized views which include calls to ST_Intersects. After dumping them via pg_dump, I am not able to restore them with pg_restore because refreshing the mat views fails:

pg_restore: [archiver (db)] Error while PROCESSING TOC:
pg_restore: [archiver (db)] Error from TOC entry 7965; 0 74457 MATERIALIZED VIEW DATA company_level_production_risk_all_sectors postgres
pg_restore: [archiver (db)] could not execute query: ERROR:  type "geometry" does not exist
LINE 1:  SELECT $1::geometry OPERATOR(public.&&) $2 AND public._st_i...
                    ^
QUERY:   SELECT $1::geometry OPERATOR(public.&&) $2 AND public._st_intersects($2, $1, $3) 
CONTEXT:  SQL function "st_intersects" during inlining
    Command was: REFRESH MATERIALIZED VIEW public.company_level_production_risk_all_sectors;

This looks similar to https://trac.osgeo.org/postgis/ticket/3012 and might be caused by a search_path problem as geometry is referred to without the schema name.

The invocation is on ST_Intersects(raster, geometry)

Change History (9)

comment:1 by robe, 6 years ago

Component: rasterpostgis
Owner: changed from dustymugs to pramsey
Priority: mediumblocker

comment:2 by robe, 6 years ago

Component: postgisraster
Owner: changed from pramsey to robe

I'm seeing this case in raster code and not in PostGIS code, so switching back to raster

comment:3 by robe, 6 years ago

Should be fixed at r17313 for PostGIS 2.5.2

I'll backport to 2.4 and upport to PostGIS 3.0.0 once tests are done

comment:4 by robe, 6 years ago

In 17314:

Schema qualify all geometry casts in raster code, otherwise materialized views do not resture
References #4291 for PostGIS 3.0.0

comment:5 by robe, 6 years ago

Resolution: fixed
Status: newclosed

In 17315:

Schema qualify all geometry casts in raster code, otherwise materialized views do not resture
Closes #4291 for PostGIS 2.4.7

comment:6 by robe, 6 years ago

Milestone: PostGIS 2.5.2PostGIS 2.4.7

comment:7 by robe, 6 years ago

In 17316:

Schema qualify all geometry casts in raster code, otherwise materialized views do not resture
Closes #4291 for PostGIS 2.5.2
Missed some spots in last commit

comment:8 by robe, 6 years ago

In 17333:

Schema qualify all geometry casts in raster code, otherwise materialized views do not resture
Closes #4291 for PostGIS 2.3.9

comment:9 by robe, 6 years ago

Milestone: PostGIS 2.4.7PostGIS 2.3.9
Note: See TracTickets for help on using tickets.