{"action":"created","issue":{"url":"https://api.github.com/repos/npgsql/npgsql/issues/696","labels_url":"https://api.github.com/repos/npgsql/npgsql/issues/696/labels{/name}","comments_url":"https://api.github.com/repos/npgsql/npgsql/issues/696/comments","events_url":"https://api.github.com/repos/npgsql/npgsql/issues/696/events","html_url":"https://github.com/npgsql/npgsql/issues/696","id":100082110,"number":696,"title":"Better support for official extension types, and 3rd party types in npgsql v3+","user":{"login":"JohannesEH","id":118692,"avatar_url":"https://avatars.githubusercontent.com/u/118692?v=3","gravatar_id":"","url":"https://api.github.com/users/JohannesEH","html_url":"https://github.com/JohannesEH","followers_url":"https://api.github.com/users/JohannesEH/followers","following_url":"https://api.github.com/users/JohannesEH/following{/other_user}","gists_url":"https://api.github.com/users/JohannesEH/gists{/gist_id}","starred_url":"https://api.github.com/users/JohannesEH/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JohannesEH/subscriptions","organizations_url":"https://api.github.com/users/JohannesEH/orgs","repos_url":"https://api.github.com/users/JohannesEH/repos","events_url":"https://api.github.com/users/JohannesEH/events{/privacy}","received_events_url":"https://api.github.com/users/JohannesEH/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-08-10T14:35:09Z","updated_at":"2015-08-11T04:23:47Z","closed_at":null,"body":"I would like to start a discussion on how improve the type mapping system to enable handling of official extension types from the following modules: [citext](http://www.postgresql.org/docs/9.4/static/citext.html), [isn](http://www.postgresql.org/docs/9.4/static/isn.html), [ltree](http://www.postgresql.org/docs/9.4/static/ltree.html), [hstore](http://www.postgresql.org/docs/9.4/static/hstore.html) and [cube](http://www.postgresql.org/docs/9.4/static/cube.html), as well as types from 3rd-party extension modules like [PostGIS](http://postgis.net/).\r\n\r\nIt would be extremely useful to be able to write your own type handling for extension types. Also, it is extremely annoying to have to jump through \"hoops\" when using official extension types such as citext. For citext you have to manually cast the citext type to text in the queries you write (afaik this wasn't the case in 2.2.5).\r\n\r\nIt seems like the TypeHandlerRegistry is not allowing any changes or additions to the default type mapping npgsql as it is marked \"internal\". I realize it is not possible to simply open this class up, but I guess this is basically what needs to be done.\r\n\r\nI'm fairly new to the npgsql codebase/project so I'm not sure if the regular maintainers see any big issues or obstacles if custom type mapping should be added to npgsql."},"comment":{"url":"https://api.github.com/repos/npgsql/npgsql/issues/comments/129698026","html_url":"https://github.com/npgsql/npgsql/issues/696#issuecomment-129698026","issue_url":"https://api.github.com/repos/npgsql/npgsql/issues/696","id":129698026,"user":{"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},"created_at":"2015-08-11T04:23:47Z","updated_at":"2015-08-11T04:23:47Z","body":"@JohannesEH, you're absolutely right that the official/standard types should be well-supported. This should have happened for the 3.0.0 release but it slipped through the cracks with the massive amount of work we had.\r\n\r\nNote that hstore is already supported in 3.0.0, and citext support has already been done for 3.0.1 (#695).\r\n\r\nMy approach is to simply add support for all the standard types, one-by-one (I'll look into the missing ones from your list ASAP). We definitely don't expect anyone to cast citext to text or anything like that: it's just a very temporary situation until we get things done.\r\n\r\nWe discussed allowing users to register external type handlers, and the new type handling system in 3.0 definitely goes in that direction. However, since everything is so new it seems much to early to allow people to go off and code against this API - I'd like to be able to change it without breaking too much. In addition, the list of additional types isn't huge - there aren't a million people writing PostgreSQL extensions out there (I think). So IMHO it's better at this stage to cover the few missing popular types (and accept PRs for others from the community) rather than open up the API for 3rd-party type handlers.\r\n\r\nBy the way, PostGIS is a more complicated case because the type system involved is non-trivial. We already merged a PR for all PostGIS 2D types (#665), but we still need the remaining (3D) types, and in any case this will most probably be released for 3.1.\r\n\r\nLet me know your thoughts."}}