{"action":"closed","issue":{"url":"https://api.github.com/repos/pgjdbc/pgjdbc/issues/431","labels_url":"https://api.github.com/repos/pgjdbc/pgjdbc/issues/431/labels{/name}","comments_url":"https://api.github.com/repos/pgjdbc/pgjdbc/issues/431/comments","events_url":"https://api.github.com/repos/pgjdbc/pgjdbc/issues/431/events","html_url":"https://github.com/pgjdbc/pgjdbc/issues/431","id":118785422,"number":431,"title":"Postgres hanging on large DDL commands","user":{"login":"zapov","id":1181401,"avatar_url":"https://avatars.githubusercontent.com/u/1181401?v=3","gravatar_id":"","url":"https://api.github.com/users/zapov","html_url":"https://github.com/zapov","followers_url":"https://api.github.com/users/zapov/followers","following_url":"https://api.github.com/users/zapov/following{/other_user}","gists_url":"https://api.github.com/users/zapov/gists{/gist_id}","starred_url":"https://api.github.com/users/zapov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zapov/subscriptions","organizations_url":"https://api.github.com/users/zapov/orgs","repos_url":"https://api.github.com/users/zapov/repos","events_url":"https://api.github.com/users/zapov/events{/privacy}","received_events_url":"https://api.github.com/users/zapov/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":31,"created_at":"2015-11-25T08:32:21Z","updated_at":"2015-12-10T10:25:21Z","closed_at":"2015-12-10T10:25:20Z","body":"I created a PR while ago: https://github.com/pgjdbc/pgjdbc/pull/365 because I had a problem with executing SQL scripts via JDBC. Recently Postgres started hanging while executing those scripts. \r\nThis happens on Windows/Linux and is reproducible with those scripts. I experimented with changing buffer sizes (send/receive) but it's not really a solution (while some scripts pass, other fails).\r\n\r\nLooking at the JDBC code it looks like it splits those large sql statements into smaller parts and tries to send them using extended protocol. It looks like Postgres doesn't cope well with that... so first obvious solution looked like just send it using simple protocol (which includes sql length - so there would be no issues).\r\n\r\nI still think that's far better solution than to rewrite that query into smaller parts.\r\nIs there any reason I'm missing why we don't use simple protocol for non prepared statements. Most queries are executed with prepared statements (to pass in the parameters)... so I can't think of a good reason not to use simple v3 protocol in that case.\r\n\r\nExecuting those scripts using v2 protocol hangs also.\r\n\r\nRegards,\r\nRikard"}}