{"action":"created","issue":{"url":"https://api.github.com/repos/serge-rider/dbeaver/issues/285","repository_url":"https://api.github.com/repos/serge-rider/dbeaver","labels_url":"https://api.github.com/repos/serge-rider/dbeaver/issues/285/labels{/name}","comments_url":"https://api.github.com/repos/serge-rider/dbeaver/issues/285/comments","events_url":"https://api.github.com/repos/serge-rider/dbeaver/issues/285/events","html_url":"https://github.com/serge-rider/dbeaver/issues/285","id":141148978,"number":285,"title":"Postgres buggy handling of text (and possibly other) types","user":{"login":"lacanoid","id":12818651,"avatar_url":"https://avatars.githubusercontent.com/u/12818651?v=3","gravatar_id":"","url":"https://api.github.com/users/lacanoid","html_url":"https://github.com/lacanoid","followers_url":"https://api.github.com/users/lacanoid/followers","following_url":"https://api.github.com/users/lacanoid/following{/other_user}","gists_url":"https://api.github.com/users/lacanoid/gists{/gist_id}","starred_url":"https://api.github.com/users/lacanoid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lacanoid/subscriptions","organizations_url":"https://api.github.com/users/lacanoid/orgs","repos_url":"https://api.github.com/users/lacanoid/repos","events_url":"https://api.github.com/users/lacanoid/events{/privacy}","received_events_url":"https://api.github.com/users/lacanoid/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/serge-rider/dbeaver/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":{"login":"serge-rider","id":6398845,"avatar_url":"https://avatars.githubusercontent.com/u/6398845?v=3","gravatar_id":"","url":"https://api.github.com/users/serge-rider","html_url":"https://github.com/serge-rider","followers_url":"https://api.github.com/users/serge-rider/followers","following_url":"https://api.github.com/users/serge-rider/following{/other_user}","gists_url":"https://api.github.com/users/serge-rider/gists{/gist_id}","starred_url":"https://api.github.com/users/serge-rider/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/serge-rider/subscriptions","organizations_url":"https://api.github.com/users/serge-rider/orgs","repos_url":"https://api.github.com/users/serge-rider/repos","events_url":"https://api.github.com/users/serge-rider/events{/privacy}","received_events_url":"https://api.github.com/users/serge-rider/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/serge-rider/dbeaver/milestones/11","html_url":"https://github.com/serge-rider/dbeaver/milestones/3.6.3","labels_url":"https://api.github.com/repos/serge-rider/dbeaver/milestones/11/labels","id":1639936,"number":11,"title":"3.6.3","description":"","creator":{"login":"serge-rider","id":6398845,"avatar_url":"https://avatars.githubusercontent.com/u/6398845?v=3","gravatar_id":"","url":"https://api.github.com/users/serge-rider","html_url":"https://github.com/serge-rider","followers_url":"https://api.github.com/users/serge-rider/followers","following_url":"https://api.github.com/users/serge-rider/following{/other_user}","gists_url":"https://api.github.com/users/serge-rider/gists{/gist_id}","starred_url":"https://api.github.com/users/serge-rider/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/serge-rider/subscriptions","organizations_url":"https://api.github.com/users/serge-rider/orgs","repos_url":"https://api.github.com/users/serge-rider/repos","events_url":"https://api.github.com/users/serge-rider/events{/privacy}","received_events_url":"https://api.github.com/users/serge-rider/received_events","type":"User","site_admin":false},"open_issues":3,"closed_issues":2,"state":"open","created_at":"2016-03-11T22:38:12Z","updated_at":"2016-03-16T06:03:32Z","due_on":"2016-03-27T21:00:00Z","closed_at":null},"comments":1,"created_at":"2016-03-16T01:56:27Z","updated_at":"2016-03-16T16:48:10Z","closed_at":null,"body":"Note: This started happening with v 3.6 and new postgres driver!\r\n\r\nIf one has a table with a name of a built-in type (\"text\" for example), this will cause the output of that column to display incorrectly. To reproduce:\r\n\r\nselect cast('Hello, world!' as text)\r\n-- displays 'Hello, world!' string, as it should\r\n\r\ncreate schema foo; create table foo.text (a int, b int);\r\n-- this creates composite type \"text\" in schema \"foo\"\r\n\r\n-- now disconnect and reconnect dbeaver session\r\n\r\nselect cast('Hello, world!' as text); \r\n-- now displays 'a' and 'b' columns, not 'Hello, world!' string as before\r\n-- note that schema foo isn't even in the search path!\r\n\r\nSometimes the result cell would display something like 'org.jkiss.dbeaver.model.impl.jdbc.data.JDBCCompositeStatic@3fcbbfd2' instead of the actual value.\r\n\r\nThis makes it rather impossible to use a table named 'text' anywhere, which is rather unfortunate, as mediawiki, for example, includes such a table :(\r\n\r\nFix: this usually happens when considering only type name, not schema in metadata processing. Fix catalog queries to handle schemas properly. Function pg_catalog.format_type() can be quite useful for finding type names.\r\n"},"comment":{"url":"https://api.github.com/repos/serge-rider/dbeaver/issues/comments/197418755","html_url":"https://github.com/serge-rider/dbeaver/issues/285#issuecomment-197418755","issue_url":"https://api.github.com/repos/serge-rider/dbeaver/issues/285","id":197418755,"user":{"login":"lacanoid","id":12818651,"avatar_url":"https://avatars.githubusercontent.com/u/12818651?v=3","gravatar_id":"","url":"https://api.github.com/users/lacanoid","html_url":"https://github.com/lacanoid","followers_url":"https://api.github.com/users/lacanoid/followers","following_url":"https://api.github.com/users/lacanoid/following{/other_user}","gists_url":"https://api.github.com/users/lacanoid/gists{/gist_id}","starred_url":"https://api.github.com/users/lacanoid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lacanoid/subscriptions","organizations_url":"https://api.github.com/users/lacanoid/orgs","repos_url":"https://api.github.com/users/lacanoid/repos","events_url":"https://api.github.com/users/lacanoid/events{/privacy}","received_events_url":"https://api.github.com/users/lacanoid/received_events","type":"User","site_admin":false},"created_at":"2016-03-16T16:48:10Z","updated_at":"2016-03-16T16:48:10Z","body":"one can also make use of queries like:\r\n\r\nselect 'text'::regtype::oid\r\nselect 'timestamp with time zone'::regtype::oid\r\nselect 'foo.text'::regtype::oid\r\n\r\nto find a type oid, while considering current search_path.\r\nNote however, that they will fail (and abort the current transaction), if the type does not exist.\r\nOn postgres 9.4+ one can also use to_regtype(), which returns null instead of error.\r\n\r\nMore useful functions for catalog queries here:\r\nhttp://www.postgresql.org/docs/current/static/functions-info.html#FUNCTIONS-INFO-CATALOG-TABLE\r\n\r\n"}}