[postgis-users] Need a "polygon box" of a table instead of the bounding box that returns extent function

Nicolas Ribot nicolas.ribot at gmail.com
Wed May 5 07:23:13 PDT 2010


> Nicolas,
> What I want to do is an insert of the type INSERT INTO...VALUES .. as
> follows:
>
> INSERT INTO boundaries ( the_geom, the_name ) VALUES
>  (some_geometry_data,'some_arbitrary_name')
>
> My problem is that I want to replace the some_geometry_data value by the
> result of the SELECT query. And of course I am not an expert user of SQL
> statements so I don't know how to do that..
> from my_street_table;
> Maybe your example can work, I will try it later and let you know.
>
> INSERT INTO boundaries ( the_geom, the_name ) SELECT
> ST_ConvexHull(ST_Collect(the_geom)) as the_geom, 'mytablename' from
> my_street_table;
>

So yes, the example, (or, better, the link to the INSERT command
reference) will help you with the query.
(When inserting with a SELECT, the VALUES keyword is not used).

Nicolas



More information about the postgis-users mailing list