{"action":"created","issue":{"url":"https://api.github.com/repos/npgsql/npgsql/issues/448","labels_url":"https://api.github.com/repos/npgsql/npgsql/issues/448/labels{/name}","comments_url":"https://api.github.com/repos/npgsql/npgsql/issues/448/comments","events_url":"https://api.github.com/repos/npgsql/npgsql/issues/448/events","html_url":"https://github.com/npgsql/npgsql/issues/448","id":53225055,"number":448,"title":"PostgreSQL numeric type supports larger numbers than .NET decimal","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},"labels":[{"url":"https://api.github.com/repos/npgsql/npgsql/labels/feature","name":"feature","color":"009800"}],"state":"open","locked":false,"assignee":{"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},"milestone":{"url":"https://api.github.com/repos/npgsql/npgsql/milestones/3","labels_url":"https://api.github.com/repos/npgsql/npgsql/milestones/3/labels","id":620657,"number":3,"title":"3.0","description":"","creator":{"login":"franciscojunior","id":829924,"avatar_url":"https://avatars.githubusercontent.com/u/829924?v=3","gravatar_id":"","url":"https://api.github.com/users/franciscojunior","html_url":"https://github.com/franciscojunior","followers_url":"https://api.github.com/users/franciscojunior/followers","following_url":"https://api.github.com/users/franciscojunior/following{/other_user}","gists_url":"https://api.github.com/users/franciscojunior/gists{/gist_id}","starred_url":"https://api.github.com/users/franciscojunior/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/franciscojunior/subscriptions","organizations_url":"https://api.github.com/users/franciscojunior/orgs","repos_url":"https://api.github.com/users/franciscojunior/repos","events_url":"https://api.github.com/users/franciscojunior/events{/privacy}","received_events_url":"https://api.github.com/users/franciscojunior/received_events","type":"User","site_admin":false},"open_issues":39,"closed_issues":20,"state":"open","created_at":"2014-04-04T16:37:19Z","updated_at":"2015-01-01T19:00:17Z","due_on":null,"closed_at":null},"comments":2,"created_at":"2015-01-01T18:09:04Z","updated_at":"2015-01-01T19:03:45Z","closed_at":null,"body":"The numeric type in PostgreSQL supports almost arbitrary large numbers.\r\nThe .NET decimal type, however, is just 128 bits.\r\nWe currently map these two types together, but we should somehow support larger numbers as well.\r\nToday an OverflowException is simply thrown when such a value is read.\r\n\r\nThe problem is, should reader.GetValue() return different types depending on how large the number is?\r\nOr should we return a decimal if there is a field description and the field type has a precision/scale that fits into a decimal, and otherwise some other data type that supports arbitrary-length values? A problem is then that if you run `select numeric_field + 1` the precision/scale attributes are dropped.\r\nAlso, what data type should be used for such numbers?"},"comment":{"url":"https://api.github.com/repos/npgsql/npgsql/issues/comments/68494867","html_url":"https://github.com/npgsql/npgsql/issues/448#issuecomment-68494867","issue_url":"https://api.github.com/repos/npgsql/npgsql/issues/448","id":68494867,"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-01-01T19:03:45Z","updated_at":"2015-01-01T19:03:45Z","body":"What happens if the user wants to use a DataAdapter? Will that call\r\nGetValue and throw an exception?\r\n\r\n\r\n2015-01-01 20:01 GMT+01:00 Shay Rojansky <notifications@github.com>:\r\n\r\n> Ah, well done for catching this.\r\n>\r\n> I think this is another case where there should be a regular type and a\r\n> provider-specific type, exactly like with date/time types. I don't think we\r\n> can really return a different type based on the actual precision, since\r\n> that makes it hard for the user to deal with return values (sometimes\r\n> GetValue() returns one type, sometimes another...).\r\n>\r\n> So I'd say we should have an NpgsqlDecimal type which can represent any\r\n> PostgreSQL decimal, and which is returned when the user calls\r\n> GetProviderSpecificValue(). If they call GetValue() (or GetDecimal()), they\r\n> get a .NET decimal, or an exception if it can't be represented.\r\n>\r\n> What do you think?\r\n>\r\n> —\r\n> Reply to this email directly or view it on GitHub\r\n> <https://github.com/npgsql/npgsql/issues/448#issuecomment-68494810>.\r\n>"}}