Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to update my table with the values from a raster stored within the database.

Edit: I've posted the answer bellow:

The query I'm trying to use is Q

update data.points_test_10000 
    set sdi_index = (
                st_value(rast,geom)  from 
                    rasters.sdi_4326 a,    
                    data.points_test_10000 b 
                    a.rast && b.geom
                    ) ;

but I'm getting the error:

more than one row returned by a subquery used as an expression

without the set statments the query works as it should

share|improve this question

Perhaps like this:

UPDATE data.points_test_10000 
    SET sdi_index = (
                st_value(a,b.geom)  from 
                    rasters.sdi_4326 a,    
                    data.points_test_10000 b 
                    (a.rast && b.geom) 
                    AND ( = 
                    ) ;
share|improve this answer
no, unfortunately it gives the same error – nickves Jun 16 '13 at 18:15
up vote 0 down vote accepted

Use ST_Intersects to limit per entry

UPDATE data.points_test_10000 p SET sdi_index = 
            rasters.sdi_4326 r 
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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