GitHub PullRequestReviewCommentEvent at 2014-06-10 12:45:45
Repository: cstore_fdw
Actor: pykello
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/citusdata/cstore_fdw/pulls/comments/13590870","id":13590870,"diff_hunk":"@@ -313,6 +330,89 @@ CopyIntoCStoreTable(const CopyStmt *copyStatement, const char *queryString)\n \n \n /*\n+ * CreateCStoreDatabaseDirectory creates the directory (and parent directories,\n+ * if needed) used to store automatically managed cstore_fdw files. The path to\n+ * the directory is $PGDATA/cstore_fdw/{databaseOid}.\n+ */\n+static void\n+CreateCStoreDatabaseDirectory(Oid databaseOid)\n+{\n+\tbool cstoreDirectoryExists = false;\n+\tbool databaseDirectoryExists = false;\n+\tStringInfo cstoreDatabaseDirectoryPath = NULL;\n+\n+\tStringInfo cstoreDirectoryPath = makeStringInfo();\n+\tappendStringInfo(cstoreDirectoryPath, \"%s/%s\", DataDir, CSTORE_FDW_NAME);\n+\n+\tcstoreDirectoryExists = DirectoryExists(cstoreDirectoryPath);\n+\tif (!cstoreDirectoryExists)\n+\t{\n+\t\tCreateDirectory(cstoreDirectoryPath);\n+\t}\n+\n+\tcstoreDatabaseDirectoryPath = makeStringInfo();\n+\tappendStringInfo(cstoreDatabaseDirectoryPath, \"%s/%s/%u\", DataDir,\n+\t\t\t\t\t CSTORE_FDW_NAME, databaseOid);\n+\n+\tdatabaseDirectoryExists = DirectoryExists(cstoreDatabaseDirectoryPath);\n+\tif (!databaseDirectoryExists)\n+\t{\n+\t\tCreateDirectory(cstoreDatabaseDirectoryPath);\n+\t}\n+}\n+\n+\n+/* DirectoryExists checks if a directory exists for the given directory name. */\n+static bool\n+DirectoryExists(StringInfo directoryName)\n+{\n+\tbool directoryExists = true;\n+\tstruct stat directoryStat;\n+\n+\tint statOK = stat(directoryName->data, &directoryStat);\n+\tif (statOK == 0)\n+\t{\n+\t\t/* file already exists; check that it is a directory */\n+\t\tif (!S_ISDIR(directoryStat.st_mode))\n+\t\t{\n+\t\t\tereport(ERROR, (errmsg(\"\\\"%s\\\" is not a directory\", directoryName->data),","path":"cstore_fdw.c","position":95,"original_position":95,"commit_id":"8fc9e1c20b7dd42b9b1c6460041b9a646fb3a612","original_commit_id":"8fc9e1c20b7dd42b9b1c6460041b9a646fb3a612","user":{"login":"pykello","id":628106,"avatar_url":"https://avatars.githubusercontent.com/u/628106?","gravatar_id":"a7448a6925f3c5e073d28a5326f40338","url":"https://api.github.com/users/pykello","html_url":"https://github.com/pykello","followers_url":"https://api.github.com/users/pykello/followers","following_url":"https://api.github.com/users/pykello/following{/other_user}","gists_url":"https://api.github.com/users/pykello/gists{/gist_id}","starred_url":"https://api.github.com/users/pykello/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pykello/subscriptions","organizations_url":"https://api.github.com/users/pykello/orgs","repos_url":"https://api.github.com/users/pykello/repos","events_url":"https://api.github.com/users/pykello/events{/privacy}","received_events_url":"https://api.github.com/users/pykello/received_events","type":"User","site_admin":false},"body":"Minor. tablespace.c uses \"\\\"%s\\\" exists but is not a directory\". Doesn't seem to be major to me and we can change this later if we want to. We should note this somewhere though.","created_at":"2014-06-10T12:45:45Z","updated_at":"2014-06-10T12:45:45Z","html_url":"https://github.com/citusdata/cstore_fdw/pull/27#discussion_r13590870","pull_request_url":"https://api.github.com/repos/citusdata/cstore_fdw/pulls/27","_links":{"self":{"href":"https://api.github.com/repos/citusdata/cstore_fdw/pulls/comments/13590870"},"html":{"href":"https://github.com/citusdata/cstore_fdw/pull/27#discussion_r13590870"},"pull_request":{"href":"https://api.github.com/repos/citusdata/cstore_fdw/pulls/27"}}},"pull_request":{"url":"https://api.github.com/repos/citusdata/cstore_fdw/pulls/27","id":16647564,"html_url":"https://github.com/citusdata/cstore_fdw/pull/27","diff_url":"https://github.com/citusdata/cstore_fdw/pull/27.diff","patch_url":"https://github.com/citusdata/cstore_fdw/pull/27.patch","issue_url":"https://api.github.com/repos/citusdata/cstore_fdw/issues/27","number":27,"state":"open","title":"Add functionality to automatically determine filename.","user":{"login":"samay-sharma","id":6285167,"avatar_url":"https://avatars.githubusercontent.com/u/6285167?","gravatar_id":"434dad3280dc53591e79d276f072e44b","url":"https://api.github.com/users/samay-sharma","html_url":"https://github.com/samay-sharma","followers_url":"https://api.github.com/users/samay-sharma/followers","following_url":"https://api.github.com/users/samay-sharma/following{/other_user}","gists_url":"https://api.github.com/users/samay-sharma/gists{/gist_id}","starred_url":"https://api.github.com/users/samay-sharma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samay-sharma/subscriptions","organizations_url":"https://api.github.com/users/samay-sharma/orgs","repos_url":"https://api.github.com/users/samay-sharma/repos","events_url":"https://api.github.com/users/samay-sharma/events{/privacy}","received_events_url":"https://api.github.com/users/samay-sharma/received_events","type":"User","site_admin":false},"body":"This change allows cstore_fdw to automatically determine the file name used to store its files.\r\n\r\nThis change makes the filename parameter optional and will use it if specified. If filename is not specified, then cstore_fdw would use $PGDATA/cstore_fdw/{database-oid}/{relfilenode} as the path for storing its files","created_at":"2014-06-03T11:30:49Z","updated_at":"2014-06-10T12:45:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4c594609bb118350941d14e7b7c4c988a036066c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/citusdata/cstore_fdw/pulls/27/commits","review_comments_url":"https://api.github.com/repos/citusdata/cstore_fdw/pulls/27/comments","review_comment_url":"https://api.github.com/repos/citusdata/cstore_fdw/pulls/comments/{number}","comments_url":"https://api.github.com/repos/citusdata/cstore_fdw/issues/27/comments","statuses_url":"https://api.github.com/repos/citusdata/cstore_fdw/statuses/8fc9e1c20b7dd42b9b1c6460041b9a646fb3a612","head":{"label":"samay-sharma:master","ref":"master","sha":"8fc9e1c20b7dd42b9b1c6460041b9a646fb3a612","user":{"login":"samay-sharma","id":6285167,"avatar_url":"https://avatars.githubusercontent.com/u/6285167?","gravatar_id":"434dad3280dc53591e79d276f072e44b","url":"https://api.github.com/users/samay-sharma","html_url":"https://github.com/samay-sharma","followers_url":"https://api.github.com/users/samay-sharma/followers","following_url":"https://api.github.com/users/samay-sharma/following{/other_user}","gists_url":"https://api.github.com/users/samay-sharma/gists{/gist_id}","starred_url":"https://api.github.com/users/samay-sharma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samay-sharma/subscriptions","organizations_url":"https://api.github.com/users/samay-sharma/orgs","repos_url":"https://api.github.com/users/samay-sharma/repos","events_url":"https://api.github.com/users/samay-sharma/events{/privacy}","received_events_url":"https://api.github.com/users/samay-sharma/received_events","type":"User","site_admin":false},"repo":{"id":20062928,"name":"cstore_fdw","full_name":"samay-sharma/cstore_fdw","owner":{"login":"samay-sharma","id":6285167,"avatar_url":"https://avatars.githubusercontent.com/u/6285167?","gravatar_id":"434dad3280dc53591e79d276f072e44b","url":"https://api.github.com/users/samay-sharma","html_url":"https://github.com/samay-sharma","followers_url":"https://api.github.com/users/samay-sharma/followers","following_url":"https://api.github.com/users/samay-sharma/following{/other_user}","gists_url":"https://api.github.com/users/samay-sharma/gists{/gist_id}","starred_url":"https://api.github.com/users/samay-sharma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samay-sharma/subscriptions","organizations_url":"https://api.github.com/users/samay-sharma/orgs","repos_url":"https://api.github.com/users/samay-sharma/repos","events_url":"https://api.github.com/users/samay-sharma/events{/privacy}","received_events_url":"https://api.github.com/users/samay-sharma/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/samay-sharma/cstore_fdw","description":"Fast columnar store for analytics with PostgreSQL","fork":true,"url":"https://api.github.com/repos/samay-sharma/cstore_fdw","forks_url":"https://api.github.com/repos/samay-sharma/cstore_fdw/forks","keys_url":"https://api.github.com/repos/samay-sharma/cstore_fdw/keys{/key_id}","collaborators_url":"https://api.github.com/repos/samay-sharma/cstore_fdw/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/samay-sharma/cstore_fdw/teams","hooks_url":"https://api.github.com/repos/samay-sharma/cstore_fdw/hooks","issue_events_url":"https://api.github.com/repos/samay-sharma/cstore_fdw/issues/events{/number}","events_url":"https://api.github.com/repos/samay-sharma/cstore_fdw/events","assignees_url":"https://api.github.com/repos/samay-sharma/cstore_fdw/assignees{/user}","branches_url":"https://api.github.com/repos/samay-sharma/cstore_fdw/branches{/branch}","tags_url":"https://api.github.com/repos/samay-sharma/cstore_fdw/tags","blobs_url":"https://api.github.com/repos/samay-sharma/cstore_fdw/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/samay-sharma/cstore_fdw/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/samay-sharma/cstore_fdw/git/refs{/sha}","trees_url":"https://api.github.com/repos/samay-sharma/cstore_fdw/git/trees{/sha}","statuses_url":"https://api.github.com/repos/samay-sharma/cstore_fdw/statuses/{sha}","languages_url":"https://api.github.com/repos/samay-sharma/cstore_fdw/languages","stargazers_url":"https://api.github.com/repos/samay-sharma/cstore_fdw/stargazers","contributors_url":"https://api.github.com/repos/samay-sharma/cstore_fdw/contributors","subscribers_url":"https://api.github.com/repos/samay-sharma/cstore_fdw/subscribers","subscription_url":"https://api.github.com/repos/samay-sharma/cstore_fdw/subscription","commits_url":"https://api.github.com/repos/samay-sharma/cstore_fdw/commits{/sha}","git_commits_url":"https://api.github.com/repos/samay-sharma/cstore_fdw/git/commits{/sha}","comments_url":"https://api.github.com/repos/samay-sharma/cstore_fdw/comments{/number}","issue_comment_url":"https://api.github.com/repos/samay-sharma/cstore_fdw/issues/comments/{number}","contents_url":"https://api.github.com/repos/samay-sharma/cstore_fdw/contents/{+path}","compare_url":"https://api.github.com/repos/samay-sharma/cstore_fdw/compare/{base}...{head}","merges_url":"https://api.github.com/repos/samay-sharma/cstore_fdw/merges","archive_url":"https://api.github.com/repos/samay-sharma/cstore_fdw/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/samay-sharma/cstore_fdw/downloads","issues_url":"https://api.github.com/repos/samay-sharma/cstore_fdw/issues{/number}","pulls_url":"https://api.github.com/repos/samay-sharma/cstore_fdw/pulls{/number}","milestones_url":"https://api.github.com/repos/samay-sharma/cstore_fdw/milestones{/number}","notifications_url":"https://api.github.com/repos/samay-sharma/cstore_fdw/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/samay-sharma/cstore_fdw/labels{/name}","releases_url":"https://api.github.com/repos/samay-sharma/cstore_fdw/releases{/id}","created_at":"2014-05-22T13:55:08Z","updated_at":"2014-06-09T09:42:32Z","pushed_at":"2014-06-09T09:42:32Z","git_url":"git://github.com/samay-sharma/cstore_fdw.git","ssh_url":"git@github.com:samay-sharma/cstore_fdw.git","clone_url":"https://github.com/samay-sharma/cstore_fdw.git","svn_url":"https://github.com/samay-sharma/cstore_fdw","homepage":"http://citusdata.github.io/cstore_fdw/","size":396,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"citusdata:develop","ref":"develop","sha":"4d92fb7f95150b482f0634d8c7b782724a317dcb","user":{"login":"citusdata","id":2545424,"avatar_url":"https://avatars.githubusercontent.com/u/2545424?","gravatar_id":"dd38f13be11e2b1f99d378cb71587d9f","url":"https://api.github.com/users/citusdata","html_url":"https://github.com/citusdata","followers_url":"https://api.github.com/users/citusdata/followers","following_url":"https://api.github.com/users/citusdata/following{/other_user}","gists_url":"https://api.github.com/users/citusdata/gists{/gist_id}","starred_url":"https://api.github.com/users/citusdata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/citusdata/subscriptions","organizations_url":"https://api.github.com/users/citusdata/orgs","repos_url":"https://api.github.com/users/citusdata/repos","events_url":"https://api.github.com/users/citusdata/events{/privacy}","received_events_url":"https://api.github.com/users/citusdata/received_events","type":"Organization","site_admin":false},"repo":{"id":18400513,"name":"cstore_fdw","full_name":"citusdata/cstore_fdw","owner":{"login":"citusdata","id":2545424,"avatar_url":"https://avatars.githubusercontent.com/u/2545424?","gravatar_id":"dd38f13be11e2b1f99d378cb71587d9f","url":"https://api.github.com/users/citusdata","html_url":"https://github.com/citusdata","followers_url":"https://api.github.com/users/citusdata/followers","following_url":"https://api.github.com/users/citusdata/following{/other_user}","gists_url":"https://api.github.com/users/citusdata/gists{/gist_id}","starred_url":"https://api.github.com/users/citusdata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/citusdata/subscriptions","organizations_url":"https://api.github.com/users/citusdata/orgs","repos_url":"https://api.github.com/users/citusdata/repos","events_url":"https://api.github.com/users/citusdata/events{/privacy}","received_events_url":"https://api.github.com/users/citusdata/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/citusdata/cstore_fdw","description":"Fast columnar store for analytics with PostgreSQL","fork":false,"url":"https://api.github.com/repos/citusdata/cstore_fdw","forks_url":"https://api.github.com/repos/citusdata/cstore_fdw/forks","keys_url":"https://api.github.com/repos/citusdata/cstore_fdw/keys{/key_id}","collaborators_url":"https://api.github.com/repos/citusdata/cstore_fdw/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/citusdata/cstore_fdw/teams","hooks_url":"https://api.github.com/repos/citusdata/cstore_fdw/hooks","issue_events_url":"https://api.github.com/repos/citusdata/cstore_fdw/issues/events{/number}","events_url":"https://api.github.com/repos/citusdata/cstore_fdw/events","assignees_url":"https://api.github.com/repos/citusdata/cstore_fdw/assignees{/user}","branches_url":"https://api.github.com/repos/citusdata/cstore_fdw/branches{/branch}","tags_url":"https://api.github.com/repos/citusdata/cstore_fdw/tags","blobs_url":"https://api.github.com/repos/citusdata/cstore_fdw/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/citusdata/cstore_fdw/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/citusdata/cstore_fdw/git/refs{/sha}","trees_url":"https://api.github.com/repos/citusdata/cstore_fdw/git/trees{/sha}","statuses_url":"https://api.github.com/repos/citusdata/cstore_fdw/statuses/{sha}","languages_url":"https://api.github.com/repos/citusdata/cstore_fdw/languages","stargazers_url":"https://api.github.com/repos/citusdata/cstore_fdw/stargazers","contributors_url":"https://api.github.com/repos/citusdata/cstore_fdw/contributors","subscribers_url":"https://api.github.com/repos/citusdata/cstore_fdw/subscribers","subscription_url":"https://api.github.com/repos/citusdata/cstore_fdw/subscription","commits_url":"https://api.github.com/repos/citusdata/cstore_fdw/commits{/sha}","git_commits_url":"https://api.github.com/repos/citusdata/cstore_fdw/git/commits{/sha}","comments_url":"https://api.github.com/repos/citusdata/cstore_fdw/comments{/number}","issue_comment_url":"https://api.github.com/repos/citusdata/cstore_fdw/issues/comments/{number}","contents_url":"https://api.github.com/repos/citusdata/cstore_fdw/contents/{+path}","compare_url":"https://api.github.com/repos/citusdata/cstore_fdw/compare/{base}...{head}","merges_url":"https://api.github.com/repos/citusdata/cstore_fdw/merges","archive_url":"https://api.github.com/repos/citusdata/cstore_fdw/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/citusdata/cstore_fdw/downloads","issues_url":"https://api.github.com/repos/citusdata/cstore_fdw/issues{/number}","pulls_url":"https://api.github.com/repos/citusdata/cstore_fdw/pulls{/number}","milestones_url":"https://api.github.com/repos/citusdata/cstore_fdw/milestones{/number}","notifications_url":"https://api.github.com/repos/citusdata/cstore_fdw/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/citusdata/cstore_fdw/labels{/name}","releases_url":"https://api.github.com/repos/citusdata/cstore_fdw/releases{/id}","created_at":"2014-04-03T11:24:43Z","updated_at":"2014-06-09T18:19:15Z","pushed_at":"2014-04-16T08:54:32Z","git_url":"git://github.com/citusdata/cstore_fdw.git","ssh_url":"git@github.com:citusdata/cstore_fdw.git","clone_url":"https://github.com/citusdata/cstore_fdw.git","svn_url":"https://github.com/citusdata/cstore_fdw","homepage":"http://citusdata.github.io/cstore_fdw/","size":928,"stargazers_count":207,"watchers_count":207,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"forks_count":19,"mirror_url":null,"open_issues_count":12,"forks":19,"open_issues":12,"watchers":207,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/citusdata/cstore_fdw/pulls/27"},"html":{"href":"https://github.com/citusdata/cstore_fdw/pull/27"},"issue":{"href":"https://api.github.com/repos/citusdata/cstore_fdw/issues/27"},"comments":{"href":"https://api.github.com/repos/citusdata/cstore_fdw/issues/27/comments"},"review_comments":{"href":"https://api.github.com/repos/citusdata/cstore_fdw/pulls/27/comments"},"review_comment":{"href":"https://api.github.com/repos/citusdata/cstore_fdw/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/citusdata/cstore_fdw/pulls/27/commits"},"statuses":{"href":"https://api.github.com/repos/citusdata/cstore_fdw/statuses/8fc9e1c20b7dd42b9b1c6460041b9a646fb3a612"}}}}