{"action":"created","issue":{"url":"https://api.github.com/repos/pomm-project/Foundation/issues/20","labels_url":"https://api.github.com/repos/pomm-project/Foundation/issues/20/labels{/name}","comments_url":"https://api.github.com/repos/pomm-project/Foundation/issues/20/comments","events_url":"https://api.github.com/repos/pomm-project/Foundation/issues/20/events","html_url":"https://github.com/pomm-project/Foundation/issues/20","id":58741363,"number":20,"title":"Escaping keyword-like column names in prepared query","user":{"login":"rijad-cz","id":3465671,"avatar_url":"https://avatars.githubusercontent.com/u/3465671?v=3","gravatar_id":"","url":"https://api.github.com/users/rijad-cz","html_url":"https://github.com/rijad-cz","followers_url":"https://api.github.com/users/rijad-cz/followers","following_url":"https://api.github.com/users/rijad-cz/following{/other_user}","gists_url":"https://api.github.com/users/rijad-cz/gists{/gist_id}","starred_url":"https://api.github.com/users/rijad-cz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rijad-cz/subscriptions","organizations_url":"https://api.github.com/users/rijad-cz/orgs","repos_url":"https://api.github.com/users/rijad-cz/repos","events_url":"https://api.github.com/users/rijad-cz/events{/privacy}","received_events_url":"https://api.github.com/users/rijad-cz/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/pomm-project/Foundation/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-02-24T13:57:50Z","updated_at":"2015-02-24T18:11:32Z","closed_at":null,"body":"Hello, I have a following problem with pomm. When I use collumn with name for example \"limit\" so I end with an error. \r\n\r\nThe problem i following; Pomm generates prepared query for example: \r\n\r\n```sql\r\nPREPARE ===\r\ninsert into travel_maxima_v1.tariffs (\"product\", \"risk\", \"limit\", \"zone\", \"tariff\") values ($1::travel_maxima_v1.product,$2::travel_maxima_v1.risk,$3::travel_maxima_v1.limit,$4::travel_maxima_v1.zone,$5::int4) returning id as id, uid as uid, created_at as created_at, created_by as created_by, updated_at as updated_at, updated_by as updated_by, product as product, risk as risk, limit as limit, zone as zone, tariff as tariff\r\n ===%\r\n```\r\n\r\nThe whole INSERT is properly escaped, bud in the \"returning\" part is limit as limit. It ends with an error.\r\nCould you fix it? \r\n\r\nThank you. "},"comment":{"url":"https://api.github.com/repos/pomm-project/Foundation/issues/comments/75812323","html_url":"https://github.com/pomm-project/Foundation/issues/20#issuecomment-75812323","issue_url":"https://api.github.com/repos/pomm-project/Foundation/issues/20","id":75812323,"user":{"login":"rijad-cz","id":3465671,"avatar_url":"https://avatars.githubusercontent.com/u/3465671?v=3","gravatar_id":"","url":"https://api.github.com/users/rijad-cz","html_url":"https://github.com/rijad-cz","followers_url":"https://api.github.com/users/rijad-cz/followers","following_url":"https://api.github.com/users/rijad-cz/following{/other_user}","gists_url":"https://api.github.com/users/rijad-cz/gists{/gist_id}","starred_url":"https://api.github.com/users/rijad-cz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rijad-cz/subscriptions","organizations_url":"https://api.github.com/users/rijad-cz/orgs","repos_url":"https://api.github.com/users/rijad-cz/repos","events_url":"https://api.github.com/users/rijad-cz/events{/privacy}","received_events_url":"https://api.github.com/users/rijad-cz/received_events","type":"User","site_admin":false},"created_at":"2015-02-24T18:11:31Z","updated_at":"2015-02-24T18:11:31Z","body":"Of course, here are my types and table definitions \r\n\r\n```sql\r\nCREATE TYPE travel_maxima_v1.\"limit\" AS ENUM\r\n   ('A',\r\n    'B',\r\n    'C');\r\n```\r\n\r\n```sql\r\nCREATE TYPE travel_maxima_v1.product AS ENUM\r\n   ('MAXCESTA');\r\n```\r\n\r\n```sql\r\nCREATE TYPE travel_maxima_v1.risk AS ENUM\r\n   ('MEDICAL_EXPENSES',\r\n    'LIABILITY',\r\n    'BAGGAGE');\r\n```\r\n\r\n```sql\r\nCREATE TYPE travel_maxima_v1.zone AS ENUM\r\n   ('EUROPE');\r\n```\r\n\r\n```sql\r\nCREATE TABLE travel_maxima_v1.tariffs\r\n(\r\n  id serial NOT NULL,\r\n  uid uuid DEFAULT uuid_generate_v4(),\r\n  created_at timestamp with time zone NOT NULL DEFAULT now(),\r\n  created_by integer NOT NULL DEFAULT 1,\r\n  updated_at timestamp with time zone NOT NULL DEFAULT now(),\r\n  updated_by integer NOT NULL DEFAULT 1,\r\n  product travel_maxima_v1.product NOT NULL,\r\n  risk travel_maxima_v1.risk NOT NULL,\r\n  \"limit\" travel_maxima_v1.\"limit\" NOT NULL,\r\n  zone travel_maxima_v1.zone NOT NULL,\r\n  tariff integer NOT NULL,\r\n  CONSTRAINT tariffs_pkey PRIMARY KEY (id)\r\n)\r\n```\r\n\r\nAll types are enums.\r\n\r\nThanks"}}