Using raster2pgsql I am able to load a NetCDF file into PostgreSQL using the PostGIS 3.1 extension. And looking at the documentation I can see that it's possible to register a raster file instead of copying the data to PostGIS using the --register flag (https://postgis.net/docs/using_raster_dataman.html):

-R, --register
Register the raster as a filesystem (out-db) raster.

Only the metadata of the raster and path location to the raster is stored in the database (not the pixels).

Then I see that there is a 40KB table in PostgreSQL that corresponds to the raster file. How can I get the file location of this raster using SQL? Surely since Postgres links to the file I can find out where the file is stored on the disk?

1 Answer 1


Bands are stored separately. You can get the path of a band with ST_BandPath.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.