{"action":"created","comment":{"url":"https://api.github.com/repos/timescale/timescaledb/pulls/comments/235172391","pull_request_review_id":176978634,"id":235172391,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzNTE3MjM5MQ==","diff_hunk":"@@ -224,74 +214,92 @@ catalog_owner(void)\n \treturn owner_oid;\n }\n \n-Catalog *\n-catalog_get(void)\n+static const char *\n+catalog_table_name(CatalogTable table)\n {\n-\tint\t\t\ti;\n-\n-\tif (!OidIsValid(MyDatabaseId))\n-\t\telog(ERROR, \"invalid database ID\");\n-\n-\tif (MyDatabaseId == catalog.database_id)\n-\t\treturn &catalog;\n+\treturn catalog_table_names[table].table_name;\n+}\n \n-\tif (!extension_is_loaded() || !IsTransactionState())\n-\t\treturn &catalog;\n+/*\n+ * Note that the first two arguments are pointers to populate.\n+ * The rest of the arguments are used to populate the first two args.\n+ */\n+void\n+catalog_populate_base(CatalogBase *catalog, CatalogTableInfo *tables, int max_tables, const TableInfoDef *table_ary, const TableIndexDef *index_ary, const char **serial_id_ary)","path":"src/catalog.c","position":71,"original_position":71,"commit_id":"7b02f98f9bc6e857ca22a8605f58adac57c21315","original_commit_id":"7b02f98f9bc6e857ca22a8605f58adac57c21315","user":{"login":"cevian","id":112245,"node_id":"MDQ6VXNlcjExMjI0NQ==","avatar_url":"https://avatars0.githubusercontent.com/u/112245?v=4","gravatar_id":"","url":"https://api.github.com/users/cevian","html_url":"https://github.com/cevian","followers_url":"https://api.github.com/users/cevian/followers","following_url":"https://api.github.com/users/cevian/following{/other_user}","gists_url":"https://api.github.com/users/cevian/gists{/gist_id}","starred_url":"https://api.github.com/users/cevian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cevian/subscriptions","organizations_url":"https://api.github.com/users/cevian/orgs","repos_url":"https://api.github.com/users/cevian/repos","events_url":"https://api.github.com/users/cevian/events{/privacy}","received_events_url":"https://api.github.com/users/cevian/received_events","type":"User","site_admin":false},"body":"naming convention for this is `catalog_base_init`","created_at":"2018-11-20T21:18:11Z","updated_at":"2018-11-20T21:50:35Z","html_url":"https://github.com/timescale/timescaledb/pull/856#discussion_r235172391","pull_request_url":"https://api.github.com/repos/timescale/timescaledb/pulls/856","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/timescale/timescaledb/pulls/comments/235172391"},"html":{"href":"https://github.com/timescale/timescaledb/pull/856#discussion_r235172391"},"pull_request":{"href":"https://api.github.com/repos/timescale/timescaledb/pulls/856"}}},"pull_request":{"url":"https://api.github.com/repos/timescale/timescaledb/pulls/856","id":232057958,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMyMDU3OTU4","html_url":"https://github.com/timescale/timescaledb/pull/856","diff_url":"https://github.com/timescale/timescaledb/pull/856.diff","patch_url":"https://github.com/timescale/timescaledb/pull/856.patch","issue_url":"https://api.github.com/repos/timescale/timescaledb/issues/856","number":856,"state":"open","locked":false,"title":"Clean up catalog code","user":{"login":"amytai","id":3322959,"node_id":"MDQ6VXNlcjMzMjI5NTk=","avatar_url":"https://avatars3.githubusercontent.com/u/3322959?v=4","gravatar_id":"","url":"https://api.github.com/users/amytai","html_url":"https://github.com/amytai","followers_url":"https://api.github.com/users/amytai/followers","following_url":"https://api.github.com/users/amytai/following{/other_user}","gists_url":"https://api.github.com/users/amytai/gists{/gist_id}","starred_url":"https://api.github.com/users/amytai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amytai/subscriptions","organizations_url":"https://api.github.com/users/amytai/orgs","repos_url":"https://api.github.com/users/amytai/repos","events_url":"https://api.github.com/users/amytai/events{/privacy}","received_events_url":"https://api.github.com/users/amytai/received_events","type":"User","site_admin":false},"body":"Organize catalog.c so that functions that access the Catalog struct are physically separate from the functions that modify the actual catalog tables on disk. Also added macros and removed some functions that aren't used outside the catalog files. Also added a prefix to the Catalog struct, because this prefix will be reused in the future.","created_at":"2018-11-19T17:40:11Z","updated_at":"2018-11-20T21:50:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fdd93a222d38a237ad2bfe4dabc0b75d210279ae","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/timescale/timescaledb/pulls/856/commits","review_comments_url":"https://api.github.com/repos/timescale/timescaledb/pulls/856/comments","review_comment_url":"https://api.github.com/repos/timescale/timescaledb/pulls/comments{/number}","comments_url":"https://api.github.com/repos/timescale/timescaledb/issues/856/comments","statuses_url":"https://api.github.com/repos/timescale/timescaledb/statuses/7b02f98f9bc6e857ca22a8605f58adac57c21315","head":{"label":"amytai:catalog_refactor","ref":"catalog_refactor","sha":"7b02f98f9bc6e857ca22a8605f58adac57c21315","user":{"login":"amytai","id":3322959,"node_id":"MDQ6VXNlcjMzMjI5NTk=","avatar_url":"https://avatars3.githubusercontent.com/u/3322959?v=4","gravatar_id":"","url":"https://api.github.com/users/amytai","html_url":"https://github.com/amytai","followers_url":"https://api.github.com/users/amytai/followers","following_url":"https://api.github.com/users/amytai/following{/other_user}","gists_url":"https://api.github.com/users/amytai/gists{/gist_id}","starred_url":"https://api.github.com/users/amytai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amytai/subscriptions","organizations_url":"https://api.github.com/users/amytai/orgs","repos_url":"https://api.github.com/users/amytai/repos","events_url":"https://api.github.com/users/amytai/events{/privacy}","received_events_url":"https://api.github.com/users/amytai/received_events","type":"User","site_admin":false},"repo":{"id":138420238,"node_id":"MDEwOlJlcG9zaXRvcnkxMzg0MjAyMzg=","name":"timescaledb","full_name":"amytai/timescaledb","private":false,"owner":{"login":"amytai","id":3322959,"node_id":"MDQ6VXNlcjMzMjI5NTk=","avatar_url":"https://avatars3.githubusercontent.com/u/3322959?v=4","gravatar_id":"","url":"https://api.github.com/users/amytai","html_url":"https://github.com/amytai","followers_url":"https://api.github.com/users/amytai/followers","following_url":"https://api.github.com/users/amytai/following{/other_user}","gists_url":"https://api.github.com/users/amytai/gists{/gist_id}","starred_url":"https://api.github.com/users/amytai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amytai/subscriptions","organizations_url":"https://api.github.com/users/amytai/orgs","repos_url":"https://api.github.com/users/amytai/repos","events_url":"https://api.github.com/users/amytai/events{/privacy}","received_events_url":"https://api.github.com/users/amytai/received_events","type":"User","site_admin":false},"html_url":"https://github.com/amytai/timescaledb","description":"An open-source time-series database optimized for fast ingest and complex queries.  Engineered up from PostgreSQL, packaged as an extension.","fork":true,"url":"https://api.github.com/repos/amytai/timescaledb","forks_url":"https://api.github.com/repos/amytai/timescaledb/forks","keys_url":"https://api.github.com/repos/amytai/timescaledb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/amytai/timescaledb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/amytai/timescaledb/teams","hooks_url":"https://api.github.com/repos/amytai/timescaledb/hooks","issue_events_url":"https://api.github.com/repos/amytai/timescaledb/issues/events{/number}","events_url":"https://api.github.com/repos/amytai/timescaledb/events","assignees_url":"https://api.github.com/repos/amytai/timescaledb/assignees{/user}","branches_url":"https://api.github.com/repos/amytai/timescaledb/branches{/branch}","tags_url":"https://api.github.com/repos/amytai/timescaledb/tags","blobs_url":"https://api.github.com/repos/amytai/timescaledb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/amytai/timescaledb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/amytai/timescaledb/git/refs{/sha}","trees_url":"https://api.github.com/repos/amytai/timescaledb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/amytai/timescaledb/statuses/{sha}","languages_url":"https://api.github.com/repos/amytai/timescaledb/languages","stargazers_url":"https://api.github.com/repos/amytai/timescaledb/stargazers","contributors_url":"https://api.github.com/repos/amytai/timescaledb/contributors","subscribers_url":"https://api.github.com/repos/amytai/timescaledb/subscribers","subscription_url":"https://api.github.com/repos/amytai/timescaledb/subscription","commits_url":"https://api.github.com/repos/amytai/timescaledb/commits{/sha}","git_commits_url":"https://api.github.com/repos/amytai/timescaledb/git/commits{/sha}","comments_url":"https://api.github.com/repos/amytai/timescaledb/comments{/number}","issue_comment_url":"https://api.github.com/repos/amytai/timescaledb/issues/comments{/number}","contents_url":"https://api.github.com/repos/amytai/timescaledb/contents/{+path}","compare_url":"https://api.github.com/repos/amytai/timescaledb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/amytai/timescaledb/merges","archive_url":"https://api.github.com/repos/amytai/timescaledb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/amytai/timescaledb/downloads","issues_url":"https://api.github.com/repos/amytai/timescaledb/issues{/number}","pulls_url":"https://api.github.com/repos/amytai/timescaledb/pulls{/number}","milestones_url":"https://api.github.com/repos/amytai/timescaledb/milestones{/number}","notifications_url":"https://api.github.com/repos/amytai/timescaledb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/amytai/timescaledb/labels{/name}","releases_url":"https://api.github.com/repos/amytai/timescaledb/releases{/id}","deployments_url":"https://api.github.com/repos/amytai/timescaledb/deployments","created_at":"2018-06-23T17:19:09Z","updated_at":"2018-11-16T19:58:59Z","pushed_at":"2018-11-20T03:13:10Z","git_url":"git://github.com/amytai/timescaledb.git","ssh_url":"git@github.com:amytai/timescaledb.git","clone_url":"https://github.com/amytai/timescaledb.git","svn_url":"https://github.com/amytai/timescaledb","homepage":"http://www.timescale.com/","size":3981,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"timescale:master","ref":"master","sha":"f3c0aa718aab18468ce152ebb849b3cdd0082e34","user":{"login":"timescale","id":8986001,"node_id":"MDEyOk9yZ2FuaXphdGlvbjg5ODYwMDE=","avatar_url":"https://avatars3.githubusercontent.com/u/8986001?v=4","gravatar_id":"","url":"https://api.github.com/users/timescale","html_url":"https://github.com/timescale","followers_url":"https://api.github.com/users/timescale/followers","following_url":"https://api.github.com/users/timescale/following{/other_user}","gists_url":"https://api.github.com/users/timescale/gists{/gist_id}","starred_url":"https://api.github.com/users/timescale/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timescale/subscriptions","organizations_url":"https://api.github.com/users/timescale/orgs","repos_url":"https://api.github.com/users/timescale/repos","events_url":"https://api.github.com/users/timescale/events{/privacy}","received_events_url":"https://api.github.com/users/timescale/received_events","type":"Organization","site_admin":false},"repo":{"id":84240850,"node_id":"MDEwOlJlcG9zaXRvcnk4NDI0MDg1MA==","name":"timescaledb","full_name":"timescale/timescaledb","private":false,"owner":{"login":"timescale","id":8986001,"node_id":"MDEyOk9yZ2FuaXphdGlvbjg5ODYwMDE=","avatar_url":"https://avatars3.githubusercontent.com/u/8986001?v=4","gravatar_id":"","url":"https://api.github.com/users/timescale","html_url":"https://github.com/timescale","followers_url":"https://api.github.com/users/timescale/followers","following_url":"https://api.github.com/users/timescale/following{/other_user}","gists_url":"https://api.github.com/users/timescale/gists{/gist_id}","starred_url":"https://api.github.com/users/timescale/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timescale/subscriptions","organizations_url":"https://api.github.com/users/timescale/orgs","repos_url":"https://api.github.com/users/timescale/repos","events_url":"https://api.github.com/users/timescale/events{/privacy}","received_events_url":"https://api.github.com/users/timescale/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/timescale/timescaledb","description":"An open-source time-series database optimized for fast ingest and complex queries.  Engineered up from PostgreSQL, packaged as an extension.","fork":false,"url":"https://api.github.com/repos/timescale/timescaledb","forks_url":"https://api.github.com/repos/timescale/timescaledb/forks","keys_url":"https://api.github.com/repos/timescale/timescaledb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/timescale/timescaledb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/timescale/timescaledb/teams","hooks_url":"https://api.github.com/repos/timescale/timescaledb/hooks","issue_events_url":"https://api.github.com/repos/timescale/timescaledb/issues/events{/number}","events_url":"https://api.github.com/repos/timescale/timescaledb/events","assignees_url":"https://api.github.com/repos/timescale/timescaledb/assignees{/user}","branches_url":"https://api.github.com/repos/timescale/timescaledb/branches{/branch}","tags_url":"https://api.github.com/repos/timescale/timescaledb/tags","blobs_url":"https://api.github.com/repos/timescale/timescaledb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/timescale/timescaledb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/timescale/timescaledb/git/refs{/sha}","trees_url":"https://api.github.com/repos/timescale/timescaledb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/timescale/timescaledb/statuses/{sha}","languages_url":"https://api.github.com/repos/timescale/timescaledb/languages","stargazers_url":"https://api.github.com/repos/timescale/timescaledb/stargazers","contributors_url":"https://api.github.com/repos/timescale/timescaledb/contributors","subscribers_url":"https://api.github.com/repos/timescale/timescaledb/subscribers","subscription_url":"https://api.github.com/repos/timescale/timescaledb/subscription","commits_url":"https://api.github.com/repos/timescale/timescaledb/commits{/sha}","git_commits_url":"https://api.github.com/repos/timescale/timescaledb/git/commits{/sha}","comments_url":"https://api.github.com/repos/timescale/timescaledb/comments{/number}","issue_comment_url":"https://api.github.com/repos/timescale/timescaledb/issues/comments{/number}","contents_url":"https://api.github.com/repos/timescale/timescaledb/contents/{+path}","compare_url":"https://api.github.com/repos/timescale/timescaledb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/timescale/timescaledb/merges","archive_url":"https://api.github.com/repos/timescale/timescaledb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/timescale/timescaledb/downloads","issues_url":"https://api.github.com/repos/timescale/timescaledb/issues{/number}","pulls_url":"https://api.github.com/repos/timescale/timescaledb/pulls{/number}","milestones_url":"https://api.github.com/repos/timescale/timescaledb/milestones{/number}","notifications_url":"https://api.github.com/repos/timescale/timescaledb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/timescale/timescaledb/labels{/name}","releases_url":"https://api.github.com/repos/timescale/timescaledb/releases{/id}","deployments_url":"https://api.github.com/repos/timescale/timescaledb/deployments","created_at":"2017-03-07T20:03:41Z","updated_at":"2018-11-20T21:43:17Z","pushed_at":"2018-11-20T21:43:14Z","git_url":"git://github.com/timescale/timescaledb.git","ssh_url":"git@github.com:timescale/timescaledb.git","clone_url":"https://github.com/timescale/timescaledb.git","svn_url":"https://github.com/timescale/timescaledb","homepage":"http://www.timescale.com/","size":3851,"stargazers_count":6127,"watchers_count":6127,"language":"C","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":289,"mirror_url":null,"archived":false,"open_issues_count":96,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":289,"open_issues":96,"watchers":6127,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/timescale/timescaledb/pulls/856"},"html":{"href":"https://github.com/timescale/timescaledb/pull/856"},"issue":{"href":"https://api.github.com/repos/timescale/timescaledb/issues/856"},"comments":{"href":"https://api.github.com/repos/timescale/timescaledb/issues/856/comments"},"review_comments":{"href":"https://api.github.com/repos/timescale/timescaledb/pulls/856/comments"},"review_comment":{"href":"https://api.github.com/repos/timescale/timescaledb/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/timescale/timescaledb/pulls/856/commits"},"statuses":{"href":"https://api.github.com/repos/timescale/timescaledb/statuses/7b02f98f9bc6e857ca22a8605f58adac57c21315"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"cevian"}}