{"action":"opened","issue":{"url":"https://api.github.com/repos/CartoDB/odbc_fdw/issues/39","repository_url":"https://api.github.com/repos/CartoDB/odbc_fdw","labels_url":"https://api.github.com/repos/CartoDB/odbc_fdw/issues/39/labels{/name}","comments_url":"https://api.github.com/repos/CartoDB/odbc_fdw/issues/39/comments","events_url":"https://api.github.com/repos/CartoDB/odbc_fdw/issues/39/events","html_url":"https://github.com/CartoDB/odbc_fdw/issues/39","id":179456339,"number":39,"title":"Inconsistency in tables_list among odbc drivers","user":{"login":"jgoizueta","id":5909,"avatar_url":"https://avatars.githubusercontent.com/u/5909?v=3","gravatar_id":"","url":"https://api.github.com/users/jgoizueta","html_url":"https://github.com/jgoizueta","followers_url":"https://api.github.com/users/jgoizueta/followers","following_url":"https://api.github.com/users/jgoizueta/following{/other_user}","gists_url":"https://api.github.com/users/jgoizueta/gists{/gist_id}","starred_url":"https://api.github.com/users/jgoizueta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jgoizueta/subscriptions","organizations_url":"https://api.github.com/users/jgoizueta/orgs","repos_url":"https://api.github.com/users/jgoizueta/repos","events_url":"https://api.github.com/users/jgoizueta/events{/privacy}","received_events_url":"https://api.github.com/users/jgoizueta/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-09-27T10:34:12Z","updated_at":"2016-09-27T10:34:12Z","closed_at":null,"body":"`SQLTables` returns the results in different columns depending on the version of ODBC implemented by the driver:\r\n\r\n## ODBC 2.0 (e.g. PostgreSQL):\r\n\r\n* `TABLE_QUALIFIER` (database name)\r\n* `TABLE_OWNER` (schema)\r\n* `TABLE_NAME`\r\n* `TABLE_TYPE`\r\n* `REMARKS`\r\n\r\n## ODBC 3.0 (e.g. MySQL, FreeTDS, Hive):\r\n\r\n* `TABLE_CAT` (database name)\r\n* `TABLE_SCHEM` (schema)\r\n* `TABLE_NAME`\r\n* `TABLE_TYPE`\r\n* `REMARKS`\r\n\r\nBut according to the [docs](https://msdn.microsoft.com/en-us/library/ms711831%28v=vs.85%29.aspx?f=255&MSPPError=-2147217396) this shouldn't matter because only the column names change:\r\n\r\n> The column name changes do not affect backward compatibility because applications bind by column number.\r\n\r\nColumn numbers for ODBC 3.0 are:\r\n1 for `TABLE_CAT`, 2 for `TABLE_SCHEM`, 3 for `TABLE_NAME`\r\n\r\nWe're using columns numbers 1 and 3:\r\nhttps://github.com/CartoDB/odbc_fdw/blob/18399f1f39cc197b62d564b7d276ef4b99c7a364/odbc_fdw.c#L1075-L1076\r\n\r\nWhich should not work (should get us dbname and table name), but it works for ODBC 2.0 (PostgreSQL driver)!\r\n\r\nFor SQL Server, MySQL it returns dbname & table name as specified.\r\n\r\nSo, it seems to me we should be using columns 2 and 3 (indices 0 and 2), but that would fail for PostgreSQL, right?\r\n"}}
{"actor":{"display_login":"jgoizueta"}}