{"action":"opened","issue":{"url":"https://api.github.com/repos/ckan/datapusher/issues/78","labels_url":"https://api.github.com/repos/ckan/datapusher/issues/78/labels{/name}","comments_url":"https://api.github.com/repos/ckan/datapusher/issues/78/comments","events_url":"https://api.github.com/repos/ckan/datapusher/issues/78/events","html_url":"https://github.com/ckan/datapusher/issues/78","id":100284435,"number":78,"title":"DataPusher should not deliberately maintain uppercase of field names","user":{"login":"timwis","id":761444,"avatar_url":"https://avatars.githubusercontent.com/u/761444?v=3","gravatar_id":"","url":"https://api.github.com/users/timwis","html_url":"https://github.com/timwis","followers_url":"https://api.github.com/users/timwis/followers","following_url":"https://api.github.com/users/timwis/following{/other_user}","gists_url":"https://api.github.com/users/timwis/gists{/gist_id}","starred_url":"https://api.github.com/users/timwis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timwis/subscriptions","organizations_url":"https://api.github.com/users/timwis/orgs","repos_url":"https://api.github.com/users/timwis/repos","events_url":"https://api.github.com/users/timwis/events{/privacy}","received_events_url":"https://api.github.com/users/timwis/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-08-11T10:37:30Z","updated_at":"2015-08-11T10:37:30Z","closed_at":null,"body":"I've noticed that if you upload a dataset with uppercase field names (which is almost always the case when pulling data from Esri/Arc databases), they get added to the postgres database with uppercase names. By default, postgres converts all field names to lowercase unless you explicitly double quote the field names. If you *do* double quote them, then you *always* need to use double quotes to interact with them.\r\n\r\nAs a result, you cannot query or use the DataStore API as the documentation suggests:\r\n\r\n`?sql=SELECT * from \"2c0d8231-e6b8-4598-8089-d1bcaf1bdaa6\" WHERE ZIP_CODE = '19146'` ([example](https://www.opendataphilly.org/api/action/datastore_search_sql?sql=SELECT%20*%20from%20%222c0d8231-e6b8-4598-8089-d1bcaf1bdaa6%22%20WHERE%20ZIP_CODE%20=%20%2719146%27))\r\nwill fail with the error `column \"zip_code\" does not exist` (note the error includes a lowercase field name - postgres converts field names to lowercase unless they're double quoted)\r\n\r\nYou must wrap the field name in double quotes to query it, ie.\r\n`?sql=SELECT * from \"2c0d8231-e6b8-4598-8089-d1bcaf1bdaa6\" WHERE \"ZIP_CODE\" = '19146'` ([example](https://www.opendataphilly.org/api/action/datastore_search_sql?sql=SELECT%20*%20from%20%222c0d8231-e6b8-4598-8089-d1bcaf1bdaa6%22%20WHERE%20%22ZIP_CODE%22%20=%20%2719146%27))\r\n\r\nMy hypothesis is that somewhere in the DataPusher extension, field names are being wrapped in double quotes, and my proposal is that they not be wrapped in double quotes. If there's some other reason they need to be (ie. to support special characters) then the field names should be converted to lowercase first to provide the expected functionality. Thoughts?"}}