{"action":"closed","issue":{"url":"https://api.github.com/repos/tilemill-project/tilemill/issues/2308","repository_url":"https://api.github.com/repos/tilemill-project/tilemill","labels_url":"https://api.github.com/repos/tilemill-project/tilemill/issues/2308/labels{/name}","comments_url":"https://api.github.com/repos/tilemill-project/tilemill/issues/2308/comments","events_url":"https://api.github.com/repos/tilemill-project/tilemill/issues/2308/events","html_url":"https://github.com/tilemill-project/tilemill/issues/2308","id":32841930,"number":2308,"title":"Correct SQL produces an error message with PostGIS plugin","user":{"login":"Zverik","id":766031,"avatar_url":"https://avatars.githubusercontent.com/u/766031?v=3","gravatar_id":"","url":"https://api.github.com/users/Zverik","html_url":"https://github.com/Zverik","followers_url":"https://api.github.com/users/Zverik/followers","following_url":"https://api.github.com/users/Zverik/following{/other_user}","gists_url":"https://api.github.com/users/Zverik/gists{/gist_id}","starred_url":"https://api.github.com/users/Zverik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Zverik/subscriptions","organizations_url":"https://api.github.com/users/Zverik/orgs","repos_url":"https://api.github.com/users/Zverik/repos","events_url":"https://api.github.com/users/Zverik/events{/privacy}","received_events_url":"https://api.github.com/users/Zverik/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2014-05-05T20:21:36Z","updated_at":"2016-10-25T19:46:41Z","closed_at":"2016-10-25T19:46:41Z","body":"Create a PostGIS layer, insert the following SQL:\r\n```sql\r\n(select st_project(pt.pt, 1000, 0)::geometry as way from (select ST_SetSRID(ST_Point(30, 60), 4326) as pt) pt) as scale\r\n```\r\nPut `way` into geometry field and click \"Save\". You will get the following error message:\r\n```\r\nPostgis Plugin: ERROR:  syntax error at or near \")\"\r\nLINE 1: ...ext) FROM (SELECT ST_Extent(way) as ext from (select) as tmp\r\n                                                                ^\r\n\r\nin executeQuery Full sql was: 'SELECT ST_XMin(ext),ST_YMin(ext),ST_XMax(ext),ST_YMax(ext) FROM (SELECT ST_Extent(way) as ext from (select) as tmp'\r\n```\r\nIf you put some simple valid SQL and then replace it with the given string, it will work with no complaints.\r\n\r\nThe bug is related to calculating extent. When I use custom extent, there is no error."}}
{"actor":{"display_login":"Komzpa"}}