{"action":"created","issue":{"url":"https://api.github.com/repos/npgsql/npgsql/issues/551","labels_url":"https://api.github.com/repos/npgsql/npgsql/issues/551/labels{/name}","comments_url":"https://api.github.com/repos/npgsql/npgsql/issues/551/comments","events_url":"https://api.github.com/repos/npgsql/npgsql/issues/551/events","html_url":"https://github.com/npgsql/npgsql/issues/551","id":63684418,"number":551,"title":"NpgsqlDate: '-infinity'/'infinity' indistinguishable from '0001-01-01'/'9999-12-31'?","user":{"login":"othulke","id":11610768,"avatar_url":"https://avatars.githubusercontent.com/u/11610768?v=3","gravatar_id":"","url":"https://api.github.com/users/othulke","html_url":"https://github.com/othulke","followers_url":"https://api.github.com/users/othulke/followers","following_url":"https://api.github.com/users/othulke/following{/other_user}","gists_url":"https://api.github.com/users/othulke/gists{/gist_id}","starred_url":"https://api.github.com/users/othulke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/othulke/subscriptions","organizations_url":"https://api.github.com/users/othulke/orgs","repos_url":"https://api.github.com/users/othulke/repos","events_url":"https://api.github.com/users/othulke/events{/privacy}","received_events_url":"https://api.github.com/users/othulke/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/npgsql/npgsql/labels/bug","name":"bug","color":"e11d21"}],"state":"closed","locked":false,"assignee":{"login":"roji","id":1862641,"avatar_url":"https://avatars.githubusercontent.com/u/1862641?v=3","gravatar_id":"","url":"https://api.github.com/users/roji","html_url":"https://github.com/roji","followers_url":"https://api.github.com/users/roji/followers","following_url":"https://api.github.com/users/roji/following{/other_user}","gists_url":"https://api.github.com/users/roji/gists{/gist_id}","starred_url":"https://api.github.com/users/roji/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/roji/subscriptions","organizations_url":"https://api.github.com/users/roji/orgs","repos_url":"https://api.github.com/users/roji/repos","events_url":"https://api.github.com/users/roji/events{/privacy}","received_events_url":"https://api.github.com/users/roji/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/npgsql/npgsql/milestones/11","html_url":"https://github.com/npgsql/npgsql/milestones/3.0-beta1","labels_url":"https://api.github.com/repos/npgsql/npgsql/milestones/11/labels","id":1045772,"number":11,"title":"3.0-beta1","description":"","creator":{"login":"roji","id":1862641,"avatar_url":"https://avatars.githubusercontent.com/u/1862641?v=3","gravatar_id":"","url":"https://api.github.com/users/roji","html_url":"https://github.com/roji","followers_url":"https://api.github.com/users/roji/followers","following_url":"https://api.github.com/users/roji/following{/other_user}","gists_url":"https://api.github.com/users/roji/gists{/gist_id}","starred_url":"https://api.github.com/users/roji/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/roji/subscriptions","organizations_url":"https://api.github.com/users/roji/orgs","repos_url":"https://api.github.com/users/roji/repos","events_url":"https://api.github.com/users/roji/events{/privacy}","received_events_url":"https://api.github.com/users/roji/received_events","type":"User","site_admin":false},"open_issues":3,"closed_issues":77,"state":"open","created_at":"2015-03-30T23:13:02Z","updated_at":"2015-05-24T15:20:32Z","due_on":null,"closed_at":null},"comments":3,"created_at":"2015-03-23T10:08:13Z","updated_at":"2015-06-23T14:21:30Z","closed_at":"2015-03-26T09:46:38Z","body":"Hi everbody,\r\n\r\nI just stumbled across a problem when reading a table containing a date column holding both `9999-12-31` and `infinity` as values.\r\nWithin postgres I'm able to distinguish between these values:\r\n`select '-infinity'::date = '0001-01-01'::date, 'infinity'::date = '9999-12-31'::date`\r\nreturns `false, false`\r\n\r\nHowever, getting the results from the statement\r\n`select 'infinity'::date, '9999-12-31'::date`\r\nusing `NpgsqlDataReader.GetProviderSpecificValues` gives me two `NpgsqlDate` objects both holding the value `9999-12-31`.\r\n\r\nThe same applies to `-infinity` and `0001-01-01`.\r\n\r\nThe difference between infinity and December 31st, 9999 might be regarded a philosophical one, but I need to be able to distinguish between these values.\r\nIs there any way I overlooked or is this an issue with NpgsqlDate?\r\n\r\nAny help is greatly appreciated!\r\n\r\nBest regards,\r\nOliver\r\n"},"comment":{"url":"https://api.github.com/repos/npgsql/npgsql/issues/comments/114521722","html_url":"https://github.com/npgsql/npgsql/issues/551#issuecomment-114521722","issue_url":"https://api.github.com/repos/npgsql/npgsql/issues/551","id":114521722,"user":{"login":"othulke","id":11610768,"avatar_url":"https://avatars.githubusercontent.com/u/11610768?v=3","gravatar_id":"","url":"https://api.github.com/users/othulke","html_url":"https://github.com/othulke","followers_url":"https://api.github.com/users/othulke/followers","following_url":"https://api.github.com/users/othulke/following{/other_user}","gists_url":"https://api.github.com/users/othulke/gists{/gist_id}","starred_url":"https://api.github.com/users/othulke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/othulke/subscriptions","organizations_url":"https://api.github.com/users/othulke/orgs","repos_url":"https://api.github.com/users/othulke/repos","events_url":"https://api.github.com/users/othulke/events{/privacy}","received_events_url":"https://api.github.com/users/othulke/received_events","type":"User","site_admin":false},"created_at":"2015-06-23T14:21:30Z","updated_at":"2015-06-23T14:21:30Z","body":"Roji, I just had a look at your changes to NpgsqlDate. I wish I could use the new version in our current project. However, as 3.0 is still Beta and doesn't support .net 4.0 anymore I had to opt for porting the changes back to 2.2.5.\r\nWhen attempting to do so, I found some places that might deserve a closer look:\r\n\r\n`NpgsqlDate.Equals`: The `default` branch doesn't check `other._type` for `[Negative]Infinity`\r\n\r\n`NpgsqlDate.GetHashCode`: Always returns `_daysSinceEra` resulting in the same hash for `NpgsqlDate.Infinity`, `NpgsqlDate.NegativeInfinity` and `new NpgsqlDate(0)`\r\n\r\nAlso a `NpgsqlDateTime` instance might hold an infinite `NpgsqlDate` in which case at least `NpgsqlDateTime.Ticks` would return an unexpected value."}}