<div dir="ltr">It would make more sense to use a view than another table. If someone forgets the where f.raster_name check the query time will increase dramatically.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Jul 2, 2023 at 7:40 PM Simon SPDBA Greener <<a href="mailto:simon@spdba.com.au">simon@spdba.com.au</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Currently when I load a raster (GDAL) into PostGIS I get a table per <br>
raster and a row per tile (if tiled).<br>
<br>
Is it possible to store multiple rasters within the same table, with a <br>
descriminator column to identify which rows belong to which raster?<br>
<br>
Such storage makes queries like this possible.<br>
<br>
SELECT ST_SummaryStats(rast)<br>
   FROM flood as f<br>
WHERE f.raster_name = 'toddriver_2019_3p0m';<br>
<br>
Or perhaps a better question: what are the pros/cons of doing so?<br>
<br>
create table toddriver_2019_2p5m (<br>
rid integer,<br>
raster_name text,<br>
rast raster );<br>
<br>
I would assume that one could not apply the constraints to this table.<br>
<br>
regards<br>
<br>
Simon<br>
<br>
-- <br>
Simon Greener<br>
39 Cliff View Drive, Allens Rivulet, 7150, Tasmania, Australia<br>
(m) +61 418 396 391<br>
(w) <a href="http://www.spdba.com.au" rel="noreferrer" target="_blank">www.spdba.com.au</a><br>
(m) <a href="mailto:simon@spdba.com.au" target="_blank">simon@spdba.com.au</a><br>
<br>
_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@lists.osgeo.org" target="_blank">postgis-users@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/postgis-users" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/postgis-users</a><br>
</blockquote></div>