{"action":"created","issue":{"url":"https://api.github.com/repos/sequelize/sequelize/issues/9460","repository_url":"https://api.github.com/repos/sequelize/sequelize","labels_url":"https://api.github.com/repos/sequelize/sequelize/issues/9460/labels{/name}","comments_url":"https://api.github.com/repos/sequelize/sequelize/issues/9460/comments","events_url":"https://api.github.com/repos/sequelize/sequelize/issues/9460/events","html_url":"https://github.com/sequelize/sequelize/issues/9460","id":324815493,"number":9460,"title":"Postgress Raw query type cast issue","user":{"login":"karankapur999","id":10877233,"avatar_url":"https://avatars0.githubusercontent.com/u/10877233?v=4","gravatar_id":"","url":"https://api.github.com/users/karankapur999","html_url":"https://github.com/karankapur999","followers_url":"https://api.github.com/users/karankapur999/followers","following_url":"https://api.github.com/users/karankapur999/following{/other_user}","gists_url":"https://api.github.com/users/karankapur999/gists{/gist_id}","starred_url":"https://api.github.com/users/karankapur999/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/karankapur999/subscriptions","organizations_url":"https://api.github.com/users/karankapur999/orgs","repos_url":"https://api.github.com/users/karankapur999/repos","events_url":"https://api.github.com/users/karankapur999/events{/privacy}","received_events_url":"https://api.github.com/users/karankapur999/received_events","type":"User","site_admin":false},"labels":[{"id":801281127,"url":"https://api.github.com/repos/sequelize/sequelize/labels/support","name":"support","color":"a5ffa0","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2018-05-21T07:29:02Z","updated_at":"2018-05-21T08:50:34Z","closed_at":"2018-05-21T07:53:35Z","author_association":"NONE","body":"\r\n\r\n<!--\r\n\r\nPlease note this is an issue tracker, not a support forum.\r\nFor general questions, please use StackOverflow or Slack.\r\n\r\nFor bugs, please fill out the template below.\r\n\r\n-->\r\n\r\n## What are you doing?\r\n\r\nI am trying to run a sequalize raw Query for postgress databse\r\n\r\nvar queryToCheckConflicts = \"select * from appointment_details where business_id =:businessId  and line_type='Appointment' and \\\"local_start_time\\\"::TIME BETWEEN (:startTime  - interval ':bufferHoursStart hours') and (:startTime  + interval ':serviceDuration hours')  and date in(:dateArray) and assigned_id = (:assignedId) LIMIT 10000;\" ;\r\n    \r\n      return global.sequelize.query(queryToCheckConflicts, { replacements: { businessId: businessId, startTime: appointmentLocalStartTime, bufferHoursStart: bufferHoursStart, serviceDuration: hoursForServiceDuration, dateArray: arrayOfDates, assignedId: staffId }, type: sequelize.QueryTypes.SELECT }).then(results => { })\r\n\r\nThe Query in consoles when ran using postico on postgress is running fine\r\n\r\nselect * from appointment_details where business_id =187  and line_type='Appointment' and \"local_start_time\"::TIME BETWEEN ('13:35'  - interval '0 hours') and ('13:35'  + interval '1 hours')   and assigned_id = ('316') LIMIT 10000;\r\n\r\n\r\nBut sequelize giving following error\r\n\r\n\r\n            \"name\": \"SequelizeDatabaseError\",\r\n            \"message\": \"syntax error at or near \\\" \\\"\",\r\n            \"parent\": {\r\n                \"name\": \"error\",\r\n                \"length\": 85,\r\n                \"severity\": \"ERROR\",\r\n                \"code\": \"42601\",\r\n                \"position\": \"133\",\r\n                \"file\": \"scan.l\",\r\n                \"line\": \"1054\",\r\n                \"routine\": \"scanner_yyerror\",\r\n                \"sql\": \"select * from appointment_details where business_id =187  and line_type='Appointment' and \\\"local_start_time\\\"::TIME BETWEEN ('13:35'  - interval '0 hours') and ('13:35'  + interval '1 hours')   and assigned_id = ('316') LIMIT 10000;\"\r\n\r\n\r\n \r\n<!-- Post a minimal, self-contained code sample that reproduces the issue, including models and associations -->\r\n\r\n```js\r\n// code here\r\n```\r\n\r\n## What do you expect to happen?\r\n_I wanted Foo!_\r\n\r\n## What is actually happening?\r\n_But the output was bar!_\r\n\r\n_Output, either JSON or SQL_\r\n\r\n\r\n__Dialect:__ mysql / postgres / sqlite / mssql / any\r\n__Dialect version:__ XXX\r\n__Database version:__ XXX\r\n__Sequelize version:__ XXX\r\n__Tested with latest release:__ No (If yes, specify that version)\r\n\r\n\r\n**Note :** _Your issue may be ignored OR closed by maintainers if it's not tested against latest version OR does not follow issue template._\r\n"},"comment":{"url":"https://api.github.com/repos/sequelize/sequelize/issues/comments/390593504","html_url":"https://github.com/sequelize/sequelize/issues/9460#issuecomment-390593504","issue_url":"https://api.github.com/repos/sequelize/sequelize/issues/9460","id":390593504,"user":{"login":"karankapur999","id":10877233,"avatar_url":"https://avatars0.githubusercontent.com/u/10877233?v=4","gravatar_id":"","url":"https://api.github.com/users/karankapur999","html_url":"https://github.com/karankapur999","followers_url":"https://api.github.com/users/karankapur999/followers","following_url":"https://api.github.com/users/karankapur999/following{/other_user}","gists_url":"https://api.github.com/users/karankapur999/gists{/gist_id}","starred_url":"https://api.github.com/users/karankapur999/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/karankapur999/subscriptions","organizations_url":"https://api.github.com/users/karankapur999/orgs","repos_url":"https://api.github.com/users/karankapur999/repos","events_url":"https://api.github.com/users/karankapur999/events{/privacy}","received_events_url":"https://api.github.com/users/karankapur999/received_events","type":"User","site_admin":false},"created_at":"2018-05-21T08:50:34Z","updated_at":"2018-05-21T08:50:34Z","author_association":"NONE","body":"@sushantdhiman how should i proceed now ?"}}
{"actor":{"display_login":"karankapur999"}}