{"action":"closed","number":901,"pull_request":{"url":"https://api.github.com/repos/dbcli/pgcli/pulls/901","id":199165137,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk5MTY1MTM3","html_url":"https://github.com/dbcli/pgcli/pull/901","diff_url":"https://github.com/dbcli/pgcli/pull/901.diff","patch_url":"https://github.com/dbcli/pgcli/pull/901.patch","issue_url":"https://api.github.com/repos/dbcli/pgcli/issues/901","number":901,"state":"closed","locked":false,"title":"Avoid reconnect prompt after error if connection is still valid","user":{"login":"saifelse","id":549473,"node_id":"MDQ6VXNlcjU0OTQ3Mw==","avatar_url":"https://avatars3.githubusercontent.com/u/549473?v=4","gravatar_id":"","url":"https://api.github.com/users/saifelse","html_url":"https://github.com/saifelse","followers_url":"https://api.github.com/users/saifelse/followers","following_url":"https://api.github.com/users/saifelse/following{/other_user}","gists_url":"https://api.github.com/users/saifelse/gists{/gist_id}","starred_url":"https://api.github.com/users/saifelse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/saifelse/subscriptions","organizations_url":"https://api.github.com/users/saifelse/orgs","repos_url":"https://api.github.com/users/saifelse/repos","events_url":"https://api.github.com/users/saifelse/events{/privacy}","received_events_url":"https://api.github.com/users/saifelse/received_events","type":"User","site_admin":false},"body":"## Description\r\nInstead of whitelisting all errors that do not require reconnecting, we simply\r\nonly reconnect if we detect a disconnect has occurred.\r\n\r\npsql notably behaves in a similar way: https://git.io/fbxuc#L1461\r\n\r\nFixes #807\r\n\r\n## Testing\r\n1. In one shell:\r\n    ```\r\n    CREATE TABLE hello ( id integer, PRIMARY KEY(id));\r\n    BEGIN;\r\n    LOCK TABLE hello IN ACCESS EXCLUSIVE MODE;\r\n    ```\r\n\r\n2. In another shell:\r\n    ```\r\n    BEGIN;\r\n    LOCK TABLE hello IN ACCESS EXCLUSIVE MODE;\r\n    ```\r\n3. Hitting Ctrl-C, results in: `^Ccanceling statement due to user request`\r\n4. Hitting a lock timeout:\r\n    ```\r\n    ROLLBACK;\r\n    BEGIN;\r\n    SET lock_timeout = 3;\r\n    LOCK TABLE hello IN ACCESS EXCLUSIVE MODE;\r\n    ```\r\n    similarly results in `canceling statement due to lock timeout`\r\n\r\n5. Attempting to perform another statement behaves as expected:\r\n    ```\r\n    postgres@localhost:mytestdb> SELECT count(*) FROM hello;\r\n    current transaction is aborted, commands ignored until end of transaction block\r\n   ```\r\n6. Running `SELECT count(*) FROM hello;` after stopping the database\r\n    correctly prompts `Connection reset. Reconnect (Y/n):`\r\n\r\n## Checklist\r\n- [x] I've added this contribution to the `changelog.rst`.\r\n- [x] I've added my name to the `AUTHORS` file (or it's already there).\r\n","created_at":"2018-07-04T07:48:45Z","updated_at":"2018-07-04T19:36:43Z","closed_at":"2018-07-04T19:36:43Z","merged_at":"2018-07-04T19:36:43Z","merge_commit_sha":"d5b0b6527bb7d962de7a7494b8335008e15cf23d","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/dbcli/pgcli/pulls/901/commits","review_comments_url":"https://api.github.com/repos/dbcli/pgcli/pulls/901/comments","review_comment_url":"https://api.github.com/repos/dbcli/pgcli/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dbcli/pgcli/issues/901/comments","statuses_url":"https://api.github.com/repos/dbcli/pgcli/statuses/e5ced8d27ec0e190c0b2593ba7bd178e127bc944","head":{"label":"benchling:fix-reconnect","ref":"fix-reconnect","sha":"e5ced8d27ec0e190c0b2593ba7bd178e127bc944","user":{"login":"benchling","id":2392113,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIzOTIxMTM=","avatar_url":"https://avatars2.githubusercontent.com/u/2392113?v=4","gravatar_id":"","url":"https://api.github.com/users/benchling","html_url":"https://github.com/benchling","followers_url":"https://api.github.com/users/benchling/followers","following_url":"https://api.github.com/users/benchling/following{/other_user}","gists_url":"https://api.github.com/users/benchling/gists{/gist_id}","starred_url":"https://api.github.com/users/benchling/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benchling/subscriptions","organizations_url":"https://api.github.com/users/benchling/orgs","repos_url":"https://api.github.com/users/benchling/repos","events_url":"https://api.github.com/users/benchling/events{/privacy}","received_events_url":"https://api.github.com/users/benchling/received_events","type":"Organization","site_admin":false},"repo":{"id":139685917,"node_id":"MDEwOlJlcG9zaXRvcnkxMzk2ODU5MTc=","name":"pgcli","full_name":"benchling/pgcli","owner":{"login":"benchling","id":2392113,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIzOTIxMTM=","avatar_url":"https://avatars2.githubusercontent.com/u/2392113?v=4","gravatar_id":"","url":"https://api.github.com/users/benchling","html_url":"https://github.com/benchling","followers_url":"https://api.github.com/users/benchling/followers","following_url":"https://api.github.com/users/benchling/following{/other_user}","gists_url":"https://api.github.com/users/benchling/gists{/gist_id}","starred_url":"https://api.github.com/users/benchling/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benchling/subscriptions","organizations_url":"https://api.github.com/users/benchling/orgs","repos_url":"https://api.github.com/users/benchling/repos","events_url":"https://api.github.com/users/benchling/events{/privacy}","received_events_url":"https://api.github.com/users/benchling/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/benchling/pgcli","description":"Postgres CLI with autocompletion and syntax highlighting","fork":true,"url":"https://api.github.com/repos/benchling/pgcli","forks_url":"https://api.github.com/repos/benchling/pgcli/forks","keys_url":"https://api.github.com/repos/benchling/pgcli/keys{/key_id}","collaborators_url":"https://api.github.com/repos/benchling/pgcli/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/benchling/pgcli/teams","hooks_url":"https://api.github.com/repos/benchling/pgcli/hooks","issue_events_url":"https://api.github.com/repos/benchling/pgcli/issues/events{/number}","events_url":"https://api.github.com/repos/benchling/pgcli/events","assignees_url":"https://api.github.com/repos/benchling/pgcli/assignees{/user}","branches_url":"https://api.github.com/repos/benchling/pgcli/branches{/branch}","tags_url":"https://api.github.com/repos/benchling/pgcli/tags","blobs_url":"https://api.github.com/repos/benchling/pgcli/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/benchling/pgcli/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/benchling/pgcli/git/refs{/sha}","trees_url":"https://api.github.com/repos/benchling/pgcli/git/trees{/sha}","statuses_url":"https://api.github.com/repos/benchling/pgcli/statuses/{sha}","languages_url":"https://api.github.com/repos/benchling/pgcli/languages","stargazers_url":"https://api.github.com/repos/benchling/pgcli/stargazers","contributors_url":"https://api.github.com/repos/benchling/pgcli/contributors","subscribers_url":"https://api.github.com/repos/benchling/pgcli/subscribers","subscription_url":"https://api.github.com/repos/benchling/pgcli/subscription","commits_url":"https://api.github.com/repos/benchling/pgcli/commits{/sha}","git_commits_url":"https://api.github.com/repos/benchling/pgcli/git/commits{/sha}","comments_url":"https://api.github.com/repos/benchling/pgcli/comments{/number}","issue_comment_url":"https://api.github.com/repos/benchling/pgcli/issues/comments{/number}","contents_url":"https://api.github.com/repos/benchling/pgcli/contents/{+path}","compare_url":"https://api.github.com/repos/benchling/pgcli/compare/{base}...{head}","merges_url":"https://api.github.com/repos/benchling/pgcli/merges","archive_url":"https://api.github.com/repos/benchling/pgcli/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/benchling/pgcli/downloads","issues_url":"https://api.github.com/repos/benchling/pgcli/issues{/number}","pulls_url":"https://api.github.com/repos/benchling/pgcli/pulls{/number}","milestones_url":"https://api.github.com/repos/benchling/pgcli/milestones{/number}","notifications_url":"https://api.github.com/repos/benchling/pgcli/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/benchling/pgcli/labels{/name}","releases_url":"https://api.github.com/repos/benchling/pgcli/releases{/id}","deployments_url":"https://api.github.com/repos/benchling/pgcli/deployments","created_at":"2018-07-04T07:35:39Z","updated_at":"2018-07-04T07:35:42Z","pushed_at":"2018-07-04T08:50:56Z","git_url":"git://github.com/benchling/pgcli.git","ssh_url":"git@github.com:benchling/pgcli.git","clone_url":"https://github.com/benchling/pgcli.git","svn_url":"https://github.com/benchling/pgcli","homepage":"http://pgcli.com","size":2564,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"bsd-3-clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause","node_id":"MDc6TGljZW5zZTU="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"dbcli:master","ref":"master","sha":"2e6e0e4acd66d4a29b64c9f3a5a08b5a9527ae80","user":{"login":"dbcli","id":11810727,"node_id":"MDEyOk9yZ2FuaXphdGlvbjExODEwNzI3","avatar_url":"https://avatars1.githubusercontent.com/u/11810727?v=4","gravatar_id":"","url":"https://api.github.com/users/dbcli","html_url":"https://github.com/dbcli","followers_url":"https://api.github.com/users/dbcli/followers","following_url":"https://api.github.com/users/dbcli/following{/other_user}","gists_url":"https://api.github.com/users/dbcli/gists{/gist_id}","starred_url":"https://api.github.com/users/dbcli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dbcli/subscriptions","organizations_url":"https://api.github.com/users/dbcli/orgs","repos_url":"https://api.github.com/users/dbcli/repos","events_url":"https://api.github.com/users/dbcli/events{/privacy}","received_events_url":"https://api.github.com/users/dbcli/received_events","type":"Organization","site_admin":false},"repo":{"id":25126616,"node_id":"MDEwOlJlcG9zaXRvcnkyNTEyNjYxNg==","name":"pgcli","full_name":"dbcli/pgcli","owner":{"login":"dbcli","id":11810727,"node_id":"MDEyOk9yZ2FuaXphdGlvbjExODEwNzI3","avatar_url":"https://avatars1.githubusercontent.com/u/11810727?v=4","gravatar_id":"","url":"https://api.github.com/users/dbcli","html_url":"https://github.com/dbcli","followers_url":"https://api.github.com/users/dbcli/followers","following_url":"https://api.github.com/users/dbcli/following{/other_user}","gists_url":"https://api.github.com/users/dbcli/gists{/gist_id}","starred_url":"https://api.github.com/users/dbcli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dbcli/subscriptions","organizations_url":"https://api.github.com/users/dbcli/orgs","repos_url":"https://api.github.com/users/dbcli/repos","events_url":"https://api.github.com/users/dbcli/events{/privacy}","received_events_url":"https://api.github.com/users/dbcli/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dbcli/pgcli","description":"Postgres CLI with autocompletion and syntax highlighting","fork":false,"url":"https://api.github.com/repos/dbcli/pgcli","forks_url":"https://api.github.com/repos/dbcli/pgcli/forks","keys_url":"https://api.github.com/repos/dbcli/pgcli/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dbcli/pgcli/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dbcli/pgcli/teams","hooks_url":"https://api.github.com/repos/dbcli/pgcli/hooks","issue_events_url":"https://api.github.com/repos/dbcli/pgcli/issues/events{/number}","events_url":"https://api.github.com/repos/dbcli/pgcli/events","assignees_url":"https://api.github.com/repos/dbcli/pgcli/assignees{/user}","branches_url":"https://api.github.com/repos/dbcli/pgcli/branches{/branch}","tags_url":"https://api.github.com/repos/dbcli/pgcli/tags","blobs_url":"https://api.github.com/repos/dbcli/pgcli/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dbcli/pgcli/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dbcli/pgcli/git/refs{/sha}","trees_url":"https://api.github.com/repos/dbcli/pgcli/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dbcli/pgcli/statuses/{sha}","languages_url":"https://api.github.com/repos/dbcli/pgcli/languages","stargazers_url":"https://api.github.com/repos/dbcli/pgcli/stargazers","contributors_url":"https://api.github.com/repos/dbcli/pgcli/contributors","subscribers_url":"https://api.github.com/repos/dbcli/pgcli/subscribers","subscription_url":"https://api.github.com/repos/dbcli/pgcli/subscription","commits_url":"https://api.github.com/repos/dbcli/pgcli/commits{/sha}","git_commits_url":"https://api.github.com/repos/dbcli/pgcli/git/commits{/sha}","comments_url":"https://api.github.com/repos/dbcli/pgcli/comments{/number}","issue_comment_url":"https://api.github.com/repos/dbcli/pgcli/issues/comments{/number}","contents_url":"https://api.github.com/repos/dbcli/pgcli/contents/{+path}","compare_url":"https://api.github.com/repos/dbcli/pgcli/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dbcli/pgcli/merges","archive_url":"https://api.github.com/repos/dbcli/pgcli/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dbcli/pgcli/downloads","issues_url":"https://api.github.com/repos/dbcli/pgcli/issues{/number}","pulls_url":"https://api.github.com/repos/dbcli/pgcli/pulls{/number}","milestones_url":"https://api.github.com/repos/dbcli/pgcli/milestones{/number}","notifications_url":"https://api.github.com/repos/dbcli/pgcli/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dbcli/pgcli/labels{/name}","releases_url":"https://api.github.com/repos/dbcli/pgcli/releases{/id}","deployments_url":"https://api.github.com/repos/dbcli/pgcli/deployments","created_at":"2014-10-12T17:32:33Z","updated_at":"2018-07-04T15:23:03Z","pushed_at":"2018-07-04T19:36:43Z","git_url":"git://github.com/dbcli/pgcli.git","ssh_url":"git@github.com:dbcli/pgcli.git","clone_url":"https://github.com/dbcli/pgcli.git","svn_url":"https://github.com/dbcli/pgcli","homepage":"http://pgcli.com","size":2541,"stargazers_count":6882,"watchers_count":6882,"language":"Python","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":314,"mirror_url":null,"archived":false,"open_issues_count":81,"license":{"key":"bsd-3-clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause","node_id":"MDc6TGljZW5zZTU="},"forks":314,"open_issues":81,"watchers":6882,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dbcli/pgcli/pulls/901"},"html":{"href":"https://github.com/dbcli/pgcli/pull/901"},"issue":{"href":"https://api.github.com/repos/dbcli/pgcli/issues/901"},"comments":{"href":"https://api.github.com/repos/dbcli/pgcli/issues/901/comments"},"review_comments":{"href":"https://api.github.com/repos/dbcli/pgcli/pulls/901/comments"},"review_comment":{"href":"https://api.github.com/repos/dbcli/pgcli/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dbcli/pgcli/pulls/901/commits"},"statuses":{"href":"https://api.github.com/repos/dbcli/pgcli/statuses/e5ced8d27ec0e190c0b2593ba7bd178e127bc944"}},"author_association":"NONE","merged":true,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":{"login":"j-bennet","id":637013,"node_id":"MDQ6VXNlcjYzNzAxMw==","avatar_url":"https://avatars1.githubusercontent.com/u/637013?v=4","gravatar_id":"","url":"https://api.github.com/users/j-bennet","html_url":"https://github.com/j-bennet","followers_url":"https://api.github.com/users/j-bennet/followers","following_url":"https://api.github.com/users/j-bennet/following{/other_user}","gists_url":"https://api.github.com/users/j-bennet/gists{/gist_id}","starred_url":"https://api.github.com/users/j-bennet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/j-bennet/subscriptions","organizations_url":"https://api.github.com/users/j-bennet/orgs","repos_url":"https://api.github.com/users/j-bennet/repos","events_url":"https://api.github.com/users/j-bennet/events{/privacy}","received_events_url":"https://api.github.com/users/j-bennet/received_events","type":"User","site_admin":false},"comments":5,"review_comments":0,"maintainer_can_modify":false,"commits":3,"additions":7,"deletions":10,"changed_files":3}}
{"actor":{"display_login":"j-bennet"}}