{"action":"created","issue":{"url":"https://api.github.com/repos/perseas/Pyrseas/issues/196","repository_url":"https://api.github.com/repos/perseas/Pyrseas","labels_url":"https://api.github.com/repos/perseas/Pyrseas/issues/196/labels{/name}","comments_url":"https://api.github.com/repos/perseas/Pyrseas/issues/196/comments","events_url":"https://api.github.com/repos/perseas/Pyrseas/issues/196/events","html_url":"https://github.com/perseas/Pyrseas/issues/196","id":373186112,"node_id":"MDU6SXNzdWUzNzMxODYxMTI=","number":196,"title":"A table called \"group\" causes a crash","user":{"login":"xclayl","id":232027,"node_id":"MDQ6VXNlcjIzMjAyNw==","avatar_url":"https://avatars1.githubusercontent.com/u/232027?v=4","gravatar_id":"","url":"https://api.github.com/users/xclayl","html_url":"https://github.com/xclayl","followers_url":"https://api.github.com/users/xclayl/followers","following_url":"https://api.github.com/users/xclayl/following{/other_user}","gists_url":"https://api.github.com/users/xclayl/gists{/gist_id}","starred_url":"https://api.github.com/users/xclayl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xclayl/subscriptions","organizations_url":"https://api.github.com/users/xclayl/orgs","repos_url":"https://api.github.com/users/xclayl/repos","events_url":"https://api.github.com/users/xclayl/events{/privacy}","received_events_url":"https://api.github.com/users/xclayl/received_events","type":"User","site_admin":false},"labels":[{"id":6054584,"node_id":"MDU6TGFiZWw2MDU0NTg0","url":"https://api.github.com/repos/perseas/Pyrseas/labels/yamltodb","name":"yamltodb","color":"444444","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-10-23T20:25:48Z","updated_at":"2018-10-24T19:42:31Z","closed_at":null,"author_association":"NONE","body":"I think it's related to foreign keys.  My guess is the FKs don't have the double quotes around \"group\" like it does below.  I'm using version 0.8.  It seems fine in version 0.7.x.  \r\n\r\nerror>> Traceback (most recent call last):\r\nerror>>   File \"c:\\users\\clay\\appdata\\local\\programs\\python\\python36-32\\lib\\runpy.py\", line 193, in _run_module_as_main\r\nerror>>     \"__main__\", mod_spec)\r\nerror>>   File \"c:\\users\\clay\\appdata\\local\\programs\\python\\python36-32\\lib\\runpy.py\", line 85, in _run_code\r\nerror>>     exec(code, run_globals)\r\nerror>>   File \"C:\\Users\\clay\\AppData\\Local\\Programs\\Python\\Python36-32\\Scripts\\yamltodb.exe\\__main__.py\", line 9, in <module>\r\nerror>>   File \"c:\\users\\clay\\appdata\\local\\programs\\python\\python36-32\\lib\\site-packages\\pyrseas\\yamltodb.py\", line 50, in main\r\nerror>>     stmts = db.diff_map(inmap)\r\nerror>>   File \"c:\\users\\clay\\appdata\\local\\programs\\python\\python36-32\\lib\\site-packages\\pyrseas\\database.py\", line 510, in diff_map\r\nerror>>     self.from_catalog()\r\nerror>>   File \"c:\\users\\clay\\appdata\\local\\programs\\python\\python36-32\\lib\\site-packages\\pyrseas\\database.py\", line 352, in from_catalog\r\nerror>>     self._link_refs(self.db)\r\nerror>>   File \"c:\\users\\clay\\appdata\\local\\programs\\python\\python36-32\\lib\\site-packages\\pyrseas\\database.py\", line 223, in _link_refs\r\nerror>>     db.triggers)\r\nerror>>   File \"c:\\users\\clay\\appdata\\local\\programs\\python\\python36-32\\lib\\site-packages\\pyrseas\\dbobject\\table.py\", line 956, in link_refs\r\nerror>>     assert self[(sch, tbl)]\r\nerror>> KeyError: ('app', '\"group\"')\r\nerror>>\r\nout>>"},"comment":{"url":"https://api.github.com/repos/perseas/Pyrseas/issues/comments/432801288","html_url":"https://github.com/perseas/Pyrseas/issues/196#issuecomment-432801288","issue_url":"https://api.github.com/repos/perseas/Pyrseas/issues/196","id":432801288,"node_id":"MDEyOklzc3VlQ29tbWVudDQzMjgwMTI4OA==","user":{"login":"xclayl","id":232027,"node_id":"MDQ6VXNlcjIzMjAyNw==","avatar_url":"https://avatars1.githubusercontent.com/u/232027?v=4","gravatar_id":"","url":"https://api.github.com/users/xclayl","html_url":"https://github.com/xclayl","followers_url":"https://api.github.com/users/xclayl/followers","following_url":"https://api.github.com/users/xclayl/following{/other_user}","gists_url":"https://api.github.com/users/xclayl/gists{/gist_id}","starred_url":"https://api.github.com/users/xclayl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xclayl/subscriptions","organizations_url":"https://api.github.com/users/xclayl/orgs","repos_url":"https://api.github.com/users/xclayl/repos","events_url":"https://api.github.com/users/xclayl/events{/privacy}","received_events_url":"https://api.github.com/users/xclayl/received_events","type":"User","site_admin":false},"created_at":"2018-10-24T19:42:31Z","updated_at":"2018-10-24T19:42:31Z","author_association":"NONE","body":"I'm using Postgres 9.6 as well.\r\n\r\nOn a whim, I executed this on the database, which comes from the yamltodb source code (line 408 in constraint.py).\r\n\r\n```\r\nSELECT conname AS name, nspname AS schema,\r\n                   conrelid::regclass AS table, conkey AS columns,\r\n                   condeferrable AS deferrable, condeferred AS deferred,\r\n                   confrelid::regclass AS ref_table, confkey AS ref_cols,\r\n                   confupdtype AS on_update, confdeltype AS on_delete,\r\n                   confmatchtype AS match, amname AS access_method,\r\n                   spcname AS tablespace, c.oid,\r\n                   indisclustered AS cluster, coninhcount > 0 AS inherited,\r\n                   obj_description(c.oid, 'pg_constraint') AS description\r\n            FROM pg_constraint c\r\n                 JOIN pg_namespace ON (connamespace = pg_namespace.oid)\r\n                 JOIN pg_index i ON (indexrelid = conindid)\r\n                 JOIN pg_class cl ON (indexrelid = cl.oid)\r\n                 JOIN pg_am on (relam = pg_am.oid)\r\n                 LEFT JOIN pg_tablespace t ON (cl.reltablespace = t.oid)\r\n            WHERE nspname != 'pg_catalog' AND nspname != 'information_schema'\r\n                  AND nspname NOT LIKE 'pg_temp\\_%'\r\n                  AND nspname NOT LIKE 'pg_toast_temp\\_%'\r\n              AND contype = 'f'\r\n              AND contypid NOT IN (SELECT objid FROM pg_depend\r\n                                   WHERE deptype = 'e'\r\n                                     AND classid = 'pg_type'::regclass)\r\n            ORDER BY schema, \"table\", name\r\n```\r\n\r\nThe ref_table column contained app.\"group\".  When I rename the table to \"groups\", the double quotes aren't in the ref_table column.  Does this help at all?"}}
{"actor":{"display_login":"xclayl"}}