ST_NumBands — Returns the number of bands in the raster object.
integer ST_NumBands(
raster rast)
;
Returns the number of bands in the raster object.
SELECT rid, ST_NumBands(rast) As numbands FROM dummy_rast; rid | numbands ----+---------- 1 | 0 2 | 3