2

I was sucessfull when I used this mode to store Raster in Postgis (raster2pgsql.exe):

C: \ Program Files \ PostgreSQL \ 9.4 \ bin> Raster2pgsql.exe -s 32373 -I -C -M C: \ Users \ Geo \ Raster \ Stockpile.jp2 -F -t 100x100 Stockpile_MRM | Psql -U postgres -d GEOSURVEY -h 192.168.1.14 -p 5432

But it goes directly to the public schema. I used this mode to change the schema (schema_name.table), but it does not work. I saw in - http://postgis.net/docs/manual-2.2/using_raster_dataman.html, but nothing changes.

C: \ Program Files \ PostgreSQL \ 9.4 \ bin> Raster2pgsql.exe -s 32373 -I -C -M C: \ Users \ Geo \ Raster \ Stockpile.jp2 -F -t 100x100 BD_Maputo.Stockpile | Psql -U postgres -d GEOSURVEY -h 192.168.1.14 -p 5432

enter image description here

what i´m doing wrong here?

2
  • Did you try putting BD_Maputo.Stockpile between double quotes? Mar 2, 2017 at 11:41
  • I did not! I will try ... Mar 2, 2017 at 11:48

1 Answer 1

3

I had the same problem, and adding double quotes didn't work for me. What solved it in the end was setting the schema search path for the whole database:

alter database <database_name> set search_path = <schema_name>,public

And then running raster2pgsql using <schema_name>.<table_name> to reference the table:

raster2pgsql.exe -s 32373 -I -C -M C: \ Users \ Geo \ Raster \ Stockpile.jp2 -F -t 100x100 BD_Maputo.Stockpile
2
  • How do you specify a quoted schema? "09-my-unusual-schema".table_name?
    – Zach Smith
    Feb 3, 2021 at 13:27
  • Ah. I see that the output of the raster2pgsql command always is quoted. And the trick is getting the schema to be in the database search path
    – Zach Smith
    Feb 3, 2021 at 13:58

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.