Yah the data directory is less likely to have screwed up permissions that the 
postgres account can’t access.  So I would go with Jorge’s idea.

 

That said I would think that having permission with r r r  should do the trick 
and the fact you can get a directory listing suggests the postgres process can 
at least read the list of files.

 

The only thing I can think of is maybe something is locking those files in some 
write mode preventing any other process from reading.  I’m assuming you are 
done with loading so shouldn’t be that.

 

To rule out postgis raster is at fault, maybe try restarting the service and do 
that pg_stat_file check again immediately after restarting.

 

Regarding your question about “Why is it offline? It's there.”

 

It’s offline because it’s not in your database. Out-db / offline are equivalent 
terminology in postgis raster.  We should probably change that terminology to 
out-db cause offline means not reachable in other contexts and just confusing.  
I think calling it out-db is a lot clearer.

 

 

From: postgis-users <postgis-users-boun...@lists.osgeo.org> On Behalf Of Jorge 
Gustavo Rocha via postgis-users
Sent: Wednesday, December 6, 2023 5:25 PM
To: postgis-users@lists.osgeo.org
Cc: Jorge Gustavo Rocha <j...@di.uminho.pt>
Subject: Re: [postgis-users] out db: not able to query the raster

 

Hi Andrea,

I always put the raster somewhere below Postgresql data_directory.

psql
show data_directory;

I hope it helps.

Saluti,

Jorge

On 04/12/23 22:23, andy via postgis-users wrote:

Hi, 

if I run "SELECT (ST_BandMetaData(rast)).* FROM rasters_outdb LIMIT 1;", in the 
field path I have "/directory_docker/ou_s6_01_01_stack.tif"

 

If I run "ls -l /directory_docker/ou_s6_01_01_stack.tif" I have

-rwxr--r-- 1 1000 1000 2100227 Dec  4 08:32 
/directory_docker/ou_s6_01_01_stack.tif

 

But when I run "SELECT ST_Value(rast, 1, 1) FROM rasters_outdb;" I get 

ERROR:  rt_band_load_offline_data: Cannot open offline raster: 
/directory_docker/ou_s6_01_01_stack.tif

 

Why is it offline? It's there.

I'm using postgis/postgis:16-master

 

I have created the sql file to load it in postgres, running

 

raster2pgsql -I -C -M -F -t auto -R /directory_docker/ou_s6_01_01_stack.tif 
public.rasters_outdb

 

How to read the pixel values using a PG SQL query?

 

Thank you


 

-- 

___________________

 

Andrea Borruso
website: https://medium.com/tantotanto
38° 7' 48" N, 13° 21' 9" E, EPSG:4326
___________________

"cercare e saper riconoscere chi e cosa,
 in mezzo all’inferno, non è inferno, 
e farlo durare, e dargli spazio"

Italo Calvino





_______________________________________________
postgis-users mailing list
postgis-users@lists.osgeo.org <mailto: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

Reply via email to