{"action":"created","issue":{"url":"https://api.github.com/repos/npgsql/npgsql/issues/641","labels_url":"https://api.github.com/repos/npgsql/npgsql/issues/641/labels{/name}","comments_url":"https://api.github.com/repos/npgsql/npgsql/issues/641/comments","events_url":"https://api.github.com/repos/npgsql/npgsql/issues/641/events","html_url":"https://github.com/npgsql/npgsql/issues/641","id":86883397,"number":641,"title":"create and execute function in same sql text throws exception","user":{"login":"Yarith","id":7803088,"avatar_url":"https://avatars.githubusercontent.com/u/7803088?v=3","gravatar_id":"","url":"https://api.github.com/users/Yarith","html_url":"https://github.com/Yarith","followers_url":"https://api.github.com/users/Yarith/followers","following_url":"https://api.github.com/users/Yarith/following{/other_user}","gists_url":"https://api.github.com/users/Yarith/gists{/gist_id}","starred_url":"https://api.github.com/users/Yarith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Yarith/subscriptions","organizations_url":"https://api.github.com/users/Yarith/orgs","repos_url":"https://api.github.com/users/Yarith/repos","events_url":"https://api.github.com/users/Yarith/events{/privacy}","received_events_url":"https://api.github.com/users/Yarith/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/npgsql/npgsql/labels/bug","name":"bug","color":"e11d21"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":14,"created_at":"2015-06-10T08:11:53Z","updated_at":"2015-06-14T14:26:13Z","closed_at":null,"body":"I got another issue with the new 3.0 version (changeset 9a8980077f6348f082e46cb78663eef2fee1e215).\r\nI have a sql text which creates a function and then executes it. Npgsql throws a NpgsqlException\r\nwhich contains a \"function does not exist\" message. The function was not created. If i remove the\r\nfunction call then the function gets created.\r\n\r\nhere is the code for a test which throws the exception with the current version:\r\n```csharp\r\n[Test]\r\npublic void CreateAndExecuteFunction()\r\n{\r\n    const string query =\r\n@\"CREATE FUNCTION pg_temp.createandexecute() \r\n  RETURNS boolean AS \r\n$BODY$DECLARE\r\nBEGIN \r\n  RETURN TRUE;\r\nEND;$BODY$\r\n  LANGUAGE 'plpgsql';\r\n\r\nSELECT pg_temp.createandexecute();\";\r\n    object result = ExecuteScalar(query);\r\n    Assert.AreEqual(true, result);\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/npgsql/npgsql/issues/comments/111831262","html_url":"https://github.com/npgsql/npgsql/issues/641#issuecomment-111831262","issue_url":"https://api.github.com/repos/npgsql/npgsql/issues/641","id":111831262,"user":{"login":"Emill","id":1660778,"avatar_url":"https://avatars.githubusercontent.com/u/1660778?v=3","gravatar_id":"","url":"https://api.github.com/users/Emill","html_url":"https://github.com/Emill","followers_url":"https://api.github.com/users/Emill/followers","following_url":"https://api.github.com/users/Emill/following{/other_user}","gists_url":"https://api.github.com/users/Emill/gists{/gist_id}","starred_url":"https://api.github.com/users/Emill/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Emill/subscriptions","organizations_url":"https://api.github.com/users/Emill/orgs","repos_url":"https://api.github.com/users/Emill/repos","events_url":"https://api.github.com/users/Emill/events{/privacy}","received_events_url":"https://api.github.com/users/Emill/received_events","type":"User","site_admin":false},"created_at":"2015-06-14T14:26:13Z","updated_at":"2015-06-14T14:26:13Z","body":"TLS is just a layer that wraps data in an encrypted and signed packet so\nthat shouldn't be an issue - except when renegotiating occurs. But\nrenegotiation normally takes place at reads (since it is at reads we handle\nTLS hello requests) so it shouldn't be a matter here.\n\nThe JDBC approach was quite bad I think when I looked at it last time. It\ndidn't handle cases with both long queries (parse + bind) AND long\nresponses at the same time. Then it was easy to get deadlock with only two\nqueries I think.\n\n\n2015-06-14 12:07 GMT+02:00 Shay Rojansky <notifications@github.com>:\n\n> (note continued discussion\n> <http://www.postgresql.org/message-id/CAH7T-aq7oc9h1iGCq-xEV=tD40RSEz1eHTn-xQTjNdPdLYoW9w@mail.gmail.com>\n> in the pgsql-hackers thread, including the JDBC driver approach to the\n> deadlock problem).\n>\n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/npgsql/npgsql/issues/641#issuecomment-111809305>.\n>\n"}}