{"action":"created","issue":{"url":"https://api.github.com/repos/QueueClassic/queue_classic/issues/257","labels_url":"https://api.github.com/repos/QueueClassic/queue_classic/issues/257/labels{/name}","comments_url":"https://api.github.com/repos/QueueClassic/queue_classic/issues/257/comments","events_url":"https://api.github.com/repos/QueueClassic/queue_classic/issues/257/events","html_url":"https://github.com/QueueClassic/queue_classic/pull/257","id":76396045,"number":257,"title":"Change json datatype to jsonb","user":{"login":"clemensg","id":201310,"avatar_url":"https://avatars.githubusercontent.com/u/201310?v=3","gravatar_id":"","url":"https://api.github.com/users/clemensg","html_url":"https://github.com/clemensg","followers_url":"https://api.github.com/users/clemensg/followers","following_url":"https://api.github.com/users/clemensg/following{/other_user}","gists_url":"https://api.github.com/users/clemensg/gists{/gist_id}","starred_url":"https://api.github.com/users/clemensg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clemensg/subscriptions","organizations_url":"https://api.github.com/users/clemensg/orgs","repos_url":"https://api.github.com/users/clemensg/repos","events_url":"https://api.github.com/users/clemensg/events{/privacy}","received_events_url":"https://api.github.com/users/clemensg/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-05-14T15:32:22Z","updated_at":"2015-05-18T12:45:45Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/QueueClassic/queue_classic/pulls/257","html_url":"https://github.com/QueueClassic/queue_classic/pull/257","diff_url":"https://github.com/QueueClassic/queue_classic/pull/257.diff","patch_url":"https://github.com/QueueClassic/queue_classic/pull/257.patch"},"body":"Hi,\r\n\r\nas the json datatype needs to be parsed over and over again and queue_classic does not make assumptions about the ordering of args' keys, a switch to jsonb seems reasonable to me.\r\n\r\nQuote from the PostgreSQL docs: *In general, most applications should prefer to store JSON data as jsonb, unless there are quite specialized needs, such as legacy assumptions about ordering of object keys.*\r\nhttp://www.postgresql.org/docs/current/static/datatype-json.html\r\n\r\nIn case somebody uses 9.3 or earlier, I think it is OK to fall back to text and not check for both jsonb and json. With text we have at least no DB performance penalty, but json is reparsed with every insert. jsonb is parsed only once."},"comment":{"url":"https://api.github.com/repos/QueueClassic/queue_classic/issues/comments/103048551","html_url":"https://github.com/QueueClassic/queue_classic/pull/257#issuecomment-103048551","issue_url":"https://api.github.com/repos/QueueClassic/queue_classic/issues/257","id":103048551,"user":{"login":"senny","id":5402,"avatar_url":"https://avatars.githubusercontent.com/u/5402?v=3","gravatar_id":"","url":"https://api.github.com/users/senny","html_url":"https://github.com/senny","followers_url":"https://api.github.com/users/senny/followers","following_url":"https://api.github.com/users/senny/following{/other_user}","gists_url":"https://api.github.com/users/senny/gists{/gist_id}","starred_url":"https://api.github.com/users/senny/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/senny/subscriptions","organizations_url":"https://api.github.com/users/senny/orgs","repos_url":"https://api.github.com/users/senny/repos","events_url":"https://api.github.com/users/senny/events{/privacy}","received_events_url":"https://api.github.com/users/senny/received_events","type":"User","site_admin":false},"created_at":"2015-05-18T12:45:45Z","updated_at":"2015-05-18T12:45:45Z","body":"I don't know the details but it depends how easily we can migrate a column. I'm expecting that PostgreSQL allows us to `ALTER TABLE` from `json` to `jsonb`. With text, this could be more demanding.\r\n\r\nCurrently I'm thinking about a simple migration which checks for `jsonb` availability and migrates `json` to `jsonb`.\r\n\r\n@clemensg can you investigate?"}}