{"action":"created","issue":{"url":"https://api.github.com/repos/npgsql/npgsql/issues/1971","repository_url":"https://api.github.com/repos/npgsql/npgsql","labels_url":"https://api.github.com/repos/npgsql/npgsql/issues/1971/labels{/name}","comments_url":"https://api.github.com/repos/npgsql/npgsql/issues/1971/comments","events_url":"https://api.github.com/repos/npgsql/npgsql/issues/1971/events","html_url":"https://github.com/npgsql/npgsql/issues/1971","id":328716084,"node_id":"MDU6SXNzdWUzMjg3MTYwODQ=","number":1971,"title":"TimeSpan auto-infers interval not time","user":{"login":"Brar","id":335902,"node_id":"MDQ6VXNlcjMzNTkwMg==","avatar_url":"https://avatars2.githubusercontent.com/u/335902?v=4","gravatar_id":"","url":"https://api.github.com/users/Brar","html_url":"https://github.com/Brar","followers_url":"https://api.github.com/users/Brar/followers","following_url":"https://api.github.com/users/Brar/following{/other_user}","gists_url":"https://api.github.com/users/Brar/gists{/gist_id}","starred_url":"https://api.github.com/users/Brar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Brar/subscriptions","organizations_url":"https://api.github.com/users/Brar/orgs","repos_url":"https://api.github.com/users/Brar/repos","events_url":"https://api.github.com/users/Brar/events{/privacy}","received_events_url":"https://api.github.com/users/Brar/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-06-02T05:39:36Z","updated_at":"2018-06-02T06:47:42Z","closed_at":"2018-06-02T06:47:42Z","author_association":"MEMBER","body":"While our [documentation](https://github.com/npgsql/npgsql/blob/dev/doc/types/basic.md) suggests that a `TimeSpan` value auto-infers the PostgreSQL type `time` when applied to an untyped parameter it actually infers `interval`.\r\n\r\n```csharp\r\n[Test]\r\npublic void ResolveTimeByClrType()\r\n{\r\n    var testValue = new TimeSpan(0, 1, 2, 3);\r\n    using (var conn = OpenConnection(ConnectionString))\r\n    {\r\n        using (var cmd = new NpgsqlCommand(\"SELECT @p\", conn))\r\n        {\r\n            cmd.Parameters.Add(new NpgsqlParameter { ParameterName = \"p\", Value = testValue });\r\n            using (var reader = cmd.ExecuteReader())\r\n            {\r\n                reader.Read();\r\n                Assert.That(reader.GetPostgresType(0).Name, Is.EqualTo(\"time\"));\r\n            }\r\n        }\r\n    }\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/npgsql/npgsql/issues/comments/394063697","html_url":"https://github.com/npgsql/npgsql/issues/1971#issuecomment-394063697","issue_url":"https://api.github.com/repos/npgsql/npgsql/issues/1971","id":394063697,"node_id":"MDEyOklzc3VlQ29tbWVudDM5NDA2MzY5Nw==","user":{"login":"Brar","id":335902,"node_id":"MDQ6VXNlcjMzNTkwMg==","avatar_url":"https://avatars2.githubusercontent.com/u/335902?v=4","gravatar_id":"","url":"https://api.github.com/users/Brar","html_url":"https://github.com/Brar","followers_url":"https://api.github.com/users/Brar/followers","following_url":"https://api.github.com/users/Brar/following{/other_user}","gists_url":"https://api.github.com/users/Brar/gists{/gist_id}","starred_url":"https://api.github.com/users/Brar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Brar/subscriptions","organizations_url":"https://api.github.com/users/Brar/orgs","repos_url":"https://api.github.com/users/Brar/repos","events_url":"https://api.github.com/users/Brar/events{/privacy}","received_events_url":"https://api.github.com/users/Brar/received_events","type":"User","site_admin":false},"created_at":"2018-06-02T06:47:42Z","updated_at":"2018-06-02T06:47:42Z","author_association":"MEMBER","body":"> Can you submit a doc fix PR?\r\n\r\nCertainly.\r\nI would have already done it if I knew whether it was a documentation bug or a code bug."}}
{"actor":{"display_login":"Brar"}}