{"action":"created","issue":{"url":"https://api.github.com/repos/CartoDB/cartodb/issues/4752","labels_url":"https://api.github.com/repos/CartoDB/cartodb/issues/4752/labels{/name}","comments_url":"https://api.github.com/repos/CartoDB/cartodb/issues/4752/comments","events_url":"https://api.github.com/repos/CartoDB/cartodb/issues/4752/events","html_url":"https://github.com/CartoDB/cartodb/pull/4752","id":97756320,"number":4752,"title":"Fixes PG::ERROR rising when renaming a table to anything starting with underscore","user":{"login":"gfiorav","id":4222826,"avatar_url":"https://avatars.githubusercontent.com/u/4222826?v=3","gravatar_id":"","url":"https://api.github.com/users/gfiorav","html_url":"https://github.com/gfiorav","followers_url":"https://api.github.com/users/gfiorav/followers","following_url":"https://api.github.com/users/gfiorav/following{/other_user}","gists_url":"https://api.github.com/users/gfiorav/gists{/gist_id}","starred_url":"https://api.github.com/users/gfiorav/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gfiorav/subscriptions","organizations_url":"https://api.github.com/users/gfiorav/orgs","repos_url":"https://api.github.com/users/gfiorav/repos","events_url":"https://api.github.com/users/gfiorav/events{/privacy}","received_events_url":"https://api.github.com/users/gfiorav/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2015-07-28T17:16:26Z","updated_at":"2015-07-29T08:05:53Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/CartoDB/cartodb/pulls/4752","html_url":"https://github.com/CartoDB/cartodb/pull/4752","diff_url":"https://github.com/CartoDB/cartodb/pull/4752.diff","patch_url":"https://github.com/CartoDB/cartodb/pull/4752.patch"},"body":"Before this fix, renaming a table to anything starting with an underscore ('_') would result in a PG::ERROR (partially described in ticket [#3428](https://github.com/CartoDB/cartodb/issues/3428)).\r\n\r\nThis error happens because the PG gem uses an intermediate table when renaming tables that happens to be the original name prefixed by an underscore, thus conflicting with the target table name and rising ```type '_original_table_name' already exists```\r\n\r\ncc @javisantana "},"comment":{"url":"https://api.github.com/repos/CartoDB/cartodb/issues/comments/125875968","html_url":"https://github.com/CartoDB/cartodb/pull/4752#issuecomment-125875968","issue_url":"https://api.github.com/repos/CartoDB/cartodb/issues/4752","id":125875968,"user":{"login":"javisantana","id":30147,"avatar_url":"https://avatars.githubusercontent.com/u/30147?v=3","gravatar_id":"","url":"https://api.github.com/users/javisantana","html_url":"https://github.com/javisantana","followers_url":"https://api.github.com/users/javisantana/followers","following_url":"https://api.github.com/users/javisantana/following{/other_user}","gists_url":"https://api.github.com/users/javisantana/gists{/gist_id}","starred_url":"https://api.github.com/users/javisantana/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/javisantana/subscriptions","organizations_url":"https://api.github.com/users/javisantana/orgs","repos_url":"https://api.github.com/users/javisantana/repos","events_url":"https://api.github.com/users/javisantana/events{/privacy}","received_events_url":"https://api.github.com/users/javisantana/received_events","type":"User","site_admin":false},"created_at":"2015-07-29T08:05:53Z","updated_at":"2015-07-29T08:05:53Z","body":"yes, that's the behavior we want but if we can't fix the underscore problem is better to avoid it"}}