{"action":"opened","issue":{"url":"https://api.github.com/repos/sequelize/sequelize/issues/4770","labels_url":"https://api.github.com/repos/sequelize/sequelize/issues/4770/labels{/name}","comments_url":"https://api.github.com/repos/sequelize/sequelize/issues/4770/comments","events_url":"https://api.github.com/repos/sequelize/sequelize/issues/4770/events","html_url":"https://github.com/sequelize/sequelize/issues/4770","id":113945129,"number":4770,"title":"Postgres: Error creating enum value that contains a space ","user":{"login":"faceleg","id":1000759,"avatar_url":"https://avatars.githubusercontent.com/u/1000759?v=3","gravatar_id":"","url":"https://api.github.com/users/faceleg","html_url":"https://github.com/faceleg","followers_url":"https://api.github.com/users/faceleg/followers","following_url":"https://api.github.com/users/faceleg/following{/other_user}","gists_url":"https://api.github.com/users/faceleg/gists{/gist_id}","starred_url":"https://api.github.com/users/faceleg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/faceleg/subscriptions","organizations_url":"https://api.github.com/users/faceleg/orgs","repos_url":"https://api.github.com/users/faceleg/repos","events_url":"https://api.github.com/users/faceleg/events{/privacy}","received_events_url":"https://api.github.com/users/faceleg/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-10-28T23:10:16Z","updated_at":"2015-10-28T23:10:16Z","closed_at":null,"body":"This is happening for me as well. Oddly, the issue went away when I removed any spaces present in the offending model's enum values.\r\n\r\nThe following failed:\r\n\r\n```JS\r\n'use strict';\r\nvar Sequelize = require('sequelize');\r\n\r\nvar sequelize = new Sequelize('postgres://postgres:password@localhost:5432/postgres', {\r\n  logging: console.log\r\n});\r\n\r\nsequelize.define('test', {\r\n  testValue: {\r\n    type: Sequelize.ENUM(['first', 'se cond'])\r\n  }\r\n});\r\n\r\nconsole.log('\\n\\nsync no force\\n\\n');\r\nsequelize.sync({\r\n  logging: console.log\r\n}).then(function() {\r\n  console.log('\\n\\nsync force\\n\\n');\r\n  return sequelize.sync({\r\n    force: true,\r\n    logging: console.log\r\n  })\r\n})\r\n.then(function() {\r\n  process.exit();\r\n});\r\n```\r\n\r\n```TEXT\r\nUnhandled rejection SequelizeDatabaseError: enum label \"se cond\" already exists\r\n    at Query.formatError (/home/USER/sequelize-issue/node_modules/sequelize/lib/dialects/postgres/query.js:443:14)\r\n    at null.<anonymous> (/home/USER/sequelize-issue/node_modules/sequelize/lib/dialects/postgres/query.js:118:19)\r\n    at emitOne (events.js:77:13)\r\n    at emit (events.js:169:7)\r\n    at Query.handleError (/home/USER/sequelize-issue/node_modules/pg/lib/query.js:108:8)\r\n    at null.<anonymous> (/home/USER/sequelize-issue/node_modules/pg/lib/client.js:171:26)\r\n    at emitOne (events.js:77:13)\r\n    at emit (events.js:169:7)\r\n    at Socket.<anonymous> (/home/USER/sequelize-issue/node_modules/pg/lib/connection.js:109:12)\r\n    at emitOne (events.js:77:13)\r\n    at Socket.emit (events.js:169:7)\r\n    at readableAddChunk (_stream_readable.js:146:16)\r\n    at Socket.Readable.push (_stream_readable.js:110:10)\r\n    at TCP.onread (net.js:523:20)\r\n```"}}