title: PostGIS point attributes to polygons, where poligon contain point
body: <p>I have a polygon database (bdus) and a point  database (bdps) under the same schema in PostGIS. These databases were imported from shapefiles with the Shapefile and DBF loader. What I want to do is to join the point attributes on the polygon layer based on the contain criteria.
  So for every polygon that contain one to n points, to add the columns of points to polygons. If there are more than one point a good approach would be to average column values.</p>
  
  <p>Can someone guide me? I am new to PostGreSQL and PostGIS but I managed to run this query</p>
  
  <pre><code>SELECT * FROM bdps
  JOIN
  bdus
  ON
  ST_Contains(bdus.the_geom, bdps.the_geom);
  </code></pre>
  
  <p>which return a table with bdps joined with the corresponding bdus, but I want the reverse.</p>
  
  <p>Thanks in advance for any help!</p>