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.
On Sun, Jul 2, 2023 at 7:40 PM Simon SPDBA Greener <si...@spdba.com.au> wrote: > Currently when I load a raster (GDAL) into PostGIS I get a table per > raster and a row per tile (if tiled). > > Is it possible to store multiple rasters within the same table, with a > descriminator column to identify which rows belong to which raster? > > Such storage makes queries like this possible. > > SELECT ST_SummaryStats(rast) > FROM flood as f > WHERE f.raster_name = 'toddriver_2019_3p0m'; > > Or perhaps a better question: what are the pros/cons of doing so? > > create table toddriver_2019_2p5m ( > rid integer, > raster_name text, > rast raster ); > > I would assume that one could not apply the constraints to this table. > > regards > > Simon > > -- > Simon Greener > 39 Cliff View Drive, Allens Rivulet, 7150, Tasmania, Australia > (m) +61 418 396 391 > (w) www.spdba.com.au > (m) si...@spdba.com.au > > _______________________________________________ > postgis-users mailing list > postgis-users@lists.osgeo.org > https://lists.osgeo.org/mailman/listinfo/postgis-users >
_______________________________________________ postgis-users mailing list postgis-users@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/postgis-users