{"version":"1.0","type":"rich","title":"Polygon insert Named Function","description":"This example shows a SQL function that inserts new polygon features into a Minneapolis dataset, limited to geometries with fewer than 100 points. The function, `AXH_NewMinneapolis`, takes an integer parent ID and a geometry, then performs an `INSERT` into the `minneapolis` table using the `RETURNING cartodb_id` clause. It is defined with `SECURITY DEFINER` to elevate privileges during execution, and `EXECUTE` permission is granted to the public user. The code uses PostgreSQL/PostGIS spatial functions like `ST_NPoints` and the CartoDB API to manage the data insertion.","provider_name":"VizHub AI Studio","provider_url":"https://next.vizhub.com","html":"<iframe src=\"https://next.vizhub.com/viz/gist-5632177?mode=embed\" width=\"960\" height=\"500\" scrolling=\"no\" frameborder=\"1\"></iframe>","width":960,"height":500,"cache_age":3600}