Getting started with Raster and PostGIS - I

Steps for loading a raster in PostGIS (PgSql 9.4/ PostGIS 2.2) and pull it from database to view in QGIS 2.14.17. 1. Generate SQL for raster [NOTE: Do not create PostGIS table name starts with underscore, it creates problem while adding raster to QGIS from PostGIS database using DB Manager] raster2pgsql -s 4326 -I -C -M -F -t 50x50 -N nan biodiv_ssolnw.tif > biodiv_ssolnw.sql 2. Import generated raster into PostGIS database [Make sure to enable postgis extension in db] psql -h localhost -U postgres -d ecolservicedb -f biodiv_ssolnw.sql the output is: Processing 1/1: ags_473038164.tif BEGIN CREATE TABLE INSERT 0 1 INSERT 0 1 INSERT 0 1 INSERT 0 1 … … …. CREATE INDEX ANALYZE NOTICE: Adding SRID constraint CONTEXT: PL/pgSQL function addrasterconstraints(name,name,name,boolean,boolean,boolean,boolean,boolean,boolean,boolean,boolean,boolean,boolean,boolean,boolean) line 53 at RETURN...