{"action":"created","issue":{"url":"https://api.github.com/repos/flynn/flynn/issues/2306","labels_url":"https://api.github.com/repos/flynn/flynn/issues/2306/labels{/name}","comments_url":"https://api.github.com/repos/flynn/flynn/issues/2306/comments","events_url":"https://api.github.com/repos/flynn/flynn/issues/2306/events","html_url":"https://github.com/flynn/flynn/pull/2306","id":122509311,"number":2306,"title":"controller: Migration listener","user":{"login":"josephglanville","id":605591,"avatar_url":"https://avatars.githubusercontent.com/u/605591?v=3","gravatar_id":"","url":"https://api.github.com/users/josephglanville","html_url":"https://github.com/josephglanville","followers_url":"https://api.github.com/users/josephglanville/followers","following_url":"https://api.github.com/users/josephglanville/following{/other_user}","gists_url":"https://api.github.com/users/josephglanville/gists{/gist_id}","starred_url":"https://api.github.com/users/josephglanville/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josephglanville/subscriptions","organizations_url":"https://api.github.com/users/josephglanville/orgs","repos_url":"https://api.github.com/users/josephglanville/repos","events_url":"https://api.github.com/users/josephglanville/events{/privacy}","received_events_url":"https://api.github.com/users/josephglanville/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-12-16T14:02:57Z","updated_at":"2015-12-16T14:11:56Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/flynn/flynn/pulls/2306","html_url":"https://github.com/flynn/flynn/pull/2306","diff_url":"https://github.com/flynn/flynn/pull/2306.diff","patch_url":"https://github.com/flynn/flynn/pull/2306.patch"},"body":"This change implements a listen/notify setup on the `schema_migrations` table in order to reset the connection pool after a migration takes place. This is to ensure any session level cached or prepared query plans can be refreshed.\r\n\r\nRefs #2295 \r\nCloses #2235"},"comment":{"url":"https://api.github.com/repos/flynn/flynn/issues/comments/165117549","html_url":"https://github.com/flynn/flynn/pull/2306#issuecomment-165117549","issue_url":"https://api.github.com/repos/flynn/flynn/issues/2306","id":165117549,"user":{"login":"josephglanville","id":605591,"avatar_url":"https://avatars.githubusercontent.com/u/605591?v=3","gravatar_id":"","url":"https://api.github.com/users/josephglanville","html_url":"https://github.com/josephglanville","followers_url":"https://api.github.com/users/josephglanville/followers","following_url":"https://api.github.com/users/josephglanville/following{/other_user}","gists_url":"https://api.github.com/users/josephglanville/gists{/gist_id}","starred_url":"https://api.github.com/users/josephglanville/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josephglanville/subscriptions","organizations_url":"https://api.github.com/users/josephglanville/orgs","repos_url":"https://api.github.com/users/josephglanville/repos","events_url":"https://api.github.com/users/josephglanville/events{/privacy}","received_events_url":"https://api.github.com/users/josephglanville/received_events","type":"User","site_admin":false},"created_at":"2015-12-16T14:11:56Z","updated_at":"2015-12-16T14:11:56Z","body":"A similar change will be needed for the router if/when it's changed to use prepared queries, this is why I implemented the core logic in `pkg/postgres` instead of in the controller itself.\r\n\r\nRight now the datastore actually generates the queries semi on the fly which is probably terrible for performance with pgx. (which anonymously prepares queries on exec if they aren't prepared already..)\r\nThat said because it doesn't use prepared queries means it's probably immune from these sorts of errors right now."}}