<div dir="ltr">Good morning,<br>I have in my postgis database, 1 raster and 1 vector polygon.<br>I would like to be able in qgis to display only pixels that are inside or intersect my polygon.<br>I would like to do a "select" only and not a create table firstly. I was thinking of using the SQL window of the BDD plugin for this.<br>Here is an example :<br><br><br><i>Coded:<br>SELECT temp_rast.*<br>FROM public.temp_rast, andra_human."FAVL_ZoneEtude_Po"<br>WHERE ST_Intersects(temp_rast.rast,"FAVL_ZoneEtude_Po".geom)</i><div><br>When I run it works. But I can't load as a new layer. I put rid for unique values. And I put rast for the geom column. FYI, My tables have indexes and constraints (pk)<br><br>Here is the error message I get in the qgis logs:<br><br><br><i>Coded:<br>2023-06-14T10:32:38 WARNING Rast field ignored because type b is not supported<br>2023-06-14T10:32:38 WARNING An error occurred while retrieving raster metadata for "public".."a", raster data parsing (which may be very slow) continues: Unable to obtain the number of bands from the value: ''..<br>              Please consider adding raster constraints with the PostGIS AddRasterConstraints function.<br>2023-06-14T10:32:38 INFO No preview found, performance may be affected for "public".."a"<br>2023-06-14T10:40:17 WARNING Bad query: SELECT 0, array_agg(DISTINCT st_srid("rast")::text || ':' || UPPER(geometrytype("rast")) || ':' | | ST_Zmflag("rast")) FROM (SELECT "rast" FROM (SELECT temp_rast.* FROM public.temp_rast, andra_human."FAVL_ZoneEtude_Po" WHERE ST_Intersects(temp_rast.rast,"FAVL_ZoneEtude_Po".geom)<br>              ) AS "subQuery_0") AS _unused returned 7 [ERROR: function geometrytype(raster) does not exist<br>              LINE 1: ...gg(DISTINCT st_srid("rast")::text || ':' || UPPER(geometryty...<br>               ^<br>              HINT: No function matches given name and argument types.<br>              You must add explicit type conversions.<br>              ]<br>2023-06-14T10:40:17 WARNING Invalid PostgreSQL layer</i><br></div><div><i><br></i></div><div><i><br></i></div><div><i>Thanks so much.</i></div><div><br></div><div><br></div><div><br></div></div>