{"action":"created","issue":{"url":"https://api.github.com/repos/rails/rails/issues/19280","labels_url":"https://api.github.com/repos/rails/rails/issues/19280/labels{/name}","comments_url":"https://api.github.com/repos/rails/rails/issues/19280/comments","events_url":"https://api.github.com/repos/rails/rails/issues/19280/events","html_url":"https://github.com/rails/rails/pull/19280","id":60575387,"number":19280,"title":"Upd pg json_test","user":{"login":"palkan","id":1516722,"avatar_url":"https://avatars.githubusercontent.com/u/1516722?v=3","gravatar_id":"","url":"https://api.github.com/users/palkan","html_url":"https://github.com/palkan","followers_url":"https://api.github.com/users/palkan/followers","following_url":"https://api.github.com/users/palkan/following{/other_user}","gists_url":"https://api.github.com/users/palkan/gists{/gist_id}","starred_url":"https://api.github.com/users/palkan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/palkan/subscriptions","organizations_url":"https://api.github.com/users/palkan/orgs","repos_url":"https://api.github.com/users/palkan/repos","events_url":"https://api.github.com/users/palkan/events{/privacy}","received_events_url":"https://api.github.com/users/palkan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-03-10T21:50:52Z","updated_at":"2015-03-10T22:00:42Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/rails/rails/pulls/19280","html_url":"https://github.com/rails/rails/pull/19280","diff_url":"https://github.com/rails/rails/pull/19280.diff","patch_url":"https://github.com/rails/rails/pull/19280.patch"},"body":"PostgresQL [json_test] tests both json and jsonb data types using tables with the same name.\r\nI've recently upgraded to PostgresQL 9.4 and I'm using rails dev virtual box. And I've seen the following errors from time to time:\r\n```\r\n1) Error:\r\nPostgresqlJSONBTest#test_rewrite:\r\nActiveRecord::StatementInvalid: PG::DatatypeMismatch: ERROR:  column \"payload\" is of type jsonb but expression is of type json at character 41\r\nHINT:  You will need to rewrite or cast the expression.\r\n\r\n1) Failure:\r\nPostgresqlJSONBTest#test_column [/vagrant/rails/activerecord/test/cases/adapters/postgresql/json_test.rb:32]:\r\nExpected: :jsonb\r\n  Actual: :json\r\n```\r\n\r\nI don't remember whether I saw such errors when were using 9.3. But the patch is simple: use different tables.\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/rails/rails/issues/comments/78158041","html_url":"https://github.com/rails/rails/pull/19280#issuecomment-78158041","issue_url":"https://api.github.com/repos/rails/rails/issues/19280","id":78158041,"user":{"login":"rafaelfranca","id":47848,"avatar_url":"https://avatars.githubusercontent.com/u/47848?v=3","gravatar_id":"","url":"https://api.github.com/users/rafaelfranca","html_url":"https://github.com/rafaelfranca","followers_url":"https://api.github.com/users/rafaelfranca/followers","following_url":"https://api.github.com/users/rafaelfranca/following{/other_user}","gists_url":"https://api.github.com/users/rafaelfranca/gists{/gist_id}","starred_url":"https://api.github.com/users/rafaelfranca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rafaelfranca/subscriptions","organizations_url":"https://api.github.com/users/rafaelfranca/orgs","repos_url":"https://api.github.com/users/rafaelfranca/repos","events_url":"https://api.github.com/users/rafaelfranca/events{/privacy}","received_events_url":"https://api.github.com/users/rafaelfranca/received_events","type":"User","site_admin":false},"created_at":"2015-03-10T22:00:42Z","updated_at":"2015-03-10T22:00:42Z","body":"Why using different tables fix this errors? Is not the test supposed to delete the table after the test runned?"}}