{"action":"created","comment":{"url":"https://api.github.com/repos/greenplum-db/gpdb/pulls/comments/49398426","id":49398426,"diff_hunk":"@@ -89,13 +90,58 @@ GpPolicyFetch(MemoryContext mcxt, Oid tbloid)\n \tRelation\tgp_policy_rel;\n \tcqContext\tcqc;\n \tHeapTuple\tgp_policy_tuple = NULL;\n-\tsize_t\t\tnb;\n \n \t/*\n \t * Skip if qExec or utility mode.\n \t */\n \tif (Gp_role != GP_ROLE_DISPATCH)\n-\t\treturn NULL;\n+\t{\n+\t\tpolicy = (GpPolicy *) MemoryContextAlloc(mcxt, SizeOfGpPolicy(0));\n+\t\tpolicy->ptype = POLICYTYPE_ENTRY;\n+\t\tpolicy->nattrs = 0;\n+\t}","path":"src/backend/cdb/cdbcat.c","position":42,"original_position":42,"commit_id":"fe0b383dcc17bd4afb511a5854d58f255b0a0879","original_commit_id":"fe0b383dcc17bd4afb511a5854d58f255b0a0879","user":{"login":"asimrp","id":4307811,"avatar_url":"https://avatars.githubusercontent.com/u/4307811?v=3","gravatar_id":"","url":"https://api.github.com/users/asimrp","html_url":"https://github.com/asimrp","followers_url":"https://api.github.com/users/asimrp/followers","following_url":"https://api.github.com/users/asimrp/following{/other_user}","gists_url":"https://api.github.com/users/asimrp/gists{/gist_id}","starred_url":"https://api.github.com/users/asimrp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asimrp/subscriptions","organizations_url":"https://api.github.com/users/asimrp/orgs","repos_url":"https://api.github.com/users/asimrp/repos","events_url":"https://api.github.com/users/asimrp/events{/privacy}","received_events_url":"https://api.github.com/users/asimrp/received_events","type":"User","site_admin":false},"body":"Missing `return policy;`?","created_at":"2016-01-12T00:01:23Z","updated_at":"2016-01-12T00:01:23Z","html_url":"https://github.com/greenplum-db/gpdb/pull/246#discussion_r49398426","pull_request_url":"https://api.github.com/repos/greenplum-db/gpdb/pulls/246","_links":{"self":{"href":"https://api.github.com/repos/greenplum-db/gpdb/pulls/comments/49398426"},"html":{"href":"https://github.com/greenplum-db/gpdb/pull/246#discussion_r49398426"},"pull_request":{"href":"https://api.github.com/repos/greenplum-db/gpdb/pulls/246"}}},"pull_request":{"url":"https://api.github.com/repos/greenplum-db/gpdb/pulls/246","id":55230578,"html_url":"https://github.com/greenplum-db/gpdb/pull/246","diff_url":"https://github.com/greenplum-db/gpdb/pull/246.diff","patch_url":"https://github.com/greenplum-db/gpdb/pull/246.patch","issue_url":"https://api.github.com/repos/greenplum-db/gpdb/issues/246","number":246,"state":"open","locked":false,"title":"Make functions in gp_toolkit to execute on all nodes as intended.","user":{"login":"hlinnaka","id":191602,"avatar_url":"https://avatars.githubusercontent.com/u/191602?v=3","gravatar_id":"","url":"https://api.github.com/users/hlinnaka","html_url":"https://github.com/hlinnaka","followers_url":"https://api.github.com/users/hlinnaka/followers","following_url":"https://api.github.com/users/hlinnaka/following{/other_user}","gists_url":"https://api.github.com/users/hlinnaka/gists{/gist_id}","starred_url":"https://api.github.com/users/hlinnaka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hlinnaka/subscriptions","organizations_url":"https://api.github.com/users/hlinnaka/orgs","repos_url":"https://api.github.com/users/hlinnaka/repos","events_url":"https://api.github.com/users/hlinnaka/events{/privacy}","received_events_url":"https://api.github.com/users/hlinnaka/received_events","type":"User","site_admin":false},"body":"Moving the installation of gp_toolkit.sql into initdb, in commit f8910c3c,\r\nbroke all the functions that are supposed to execute on all nodes, like\r\ngp_toolkit.__gp_localid. After that change, gp_toolkit.sql was executed\r\nin utility mode, and the gp_distribution_policy entries for those functions\r\nwere not created as a result.\r\n\r\nTo fix, change the code so that gp_distribution_policy entries are never\r\nnever created, or consulted, for EXECUTE-type external tables. They have\r\nmore fine-grained information in pg_exttable.location field anyway, so rely\r\non that instead. With this change, there is no difference in whether an\r\nEXECUTE-type external table is created in utility mode or not. We would\r\nstill have similar problems if gp_toolkit contained other kinds of\r\nexternal tables, but it doesn't.\r\n\r\nThis removes the isMasterOnly() function and changes all its callers to\r\ncall GpPolicyFetch() directly instead. Some places used GpPolicyFetch()\r\ndirectly to check if a table is distributed, so this just makes that the\r\ncanonical way to do it. The check for system schemas that used to be in\r\nisMasterOnly() are no longer performed, but they should've unnecessary in\r\nthe first place. System tables don't have gp_distribution_policy entries,\r\nso they'll be treated as master-only even without that check.","created_at":"2016-01-06T16:15:01Z","updated_at":"2016-01-12T00:01:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"725bf3234a5b21f80153be0c4dc0a528ec6e941b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/greenplum-db/gpdb/pulls/246/commits","review_comments_url":"https://api.github.com/repos/greenplum-db/gpdb/pulls/246/comments","review_comment_url":"https://api.github.com/repos/greenplum-db/gpdb/pulls/comments{/number}","comments_url":"https://api.github.com/repos/greenplum-db/gpdb/issues/246/comments","statuses_url":"https://api.github.com/repos/greenplum-db/gpdb/statuses/fe0b383dcc17bd4afb511a5854d58f255b0a0879","head":{"label":"hlinnaka:gp_toolkit-exttable-fix","ref":"gp_toolkit-exttable-fix","sha":"fe0b383dcc17bd4afb511a5854d58f255b0a0879","user":{"login":"hlinnaka","id":191602,"avatar_url":"https://avatars.githubusercontent.com/u/191602?v=3","gravatar_id":"","url":"https://api.github.com/users/hlinnaka","html_url":"https://github.com/hlinnaka","followers_url":"https://api.github.com/users/hlinnaka/followers","following_url":"https://api.github.com/users/hlinnaka/following{/other_user}","gists_url":"https://api.github.com/users/hlinnaka/gists{/gist_id}","starred_url":"https://api.github.com/users/hlinnaka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hlinnaka/subscriptions","organizations_url":"https://api.github.com/users/hlinnaka/orgs","repos_url":"https://api.github.com/users/hlinnaka/repos","events_url":"https://api.github.com/users/hlinnaka/events{/privacy}","received_events_url":"https://api.github.com/users/hlinnaka/received_events","type":"User","site_admin":false},"repo":{"id":45393662,"name":"gpdb","full_name":"hlinnaka/gpdb","owner":{"login":"hlinnaka","id":191602,"avatar_url":"https://avatars.githubusercontent.com/u/191602?v=3","gravatar_id":"","url":"https://api.github.com/users/hlinnaka","html_url":"https://github.com/hlinnaka","followers_url":"https://api.github.com/users/hlinnaka/followers","following_url":"https://api.github.com/users/hlinnaka/following{/other_user}","gists_url":"https://api.github.com/users/hlinnaka/gists{/gist_id}","starred_url":"https://api.github.com/users/hlinnaka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hlinnaka/subscriptions","organizations_url":"https://api.github.com/users/hlinnaka/orgs","repos_url":"https://api.github.com/users/hlinnaka/repos","events_url":"https://api.github.com/users/hlinnaka/events{/privacy}","received_events_url":"https://api.github.com/users/hlinnaka/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/hlinnaka/gpdb","description":"Pivotal Greenplum Database","fork":true,"url":"https://api.github.com/repos/hlinnaka/gpdb","forks_url":"https://api.github.com/repos/hlinnaka/gpdb/forks","keys_url":"https://api.github.com/repos/hlinnaka/gpdb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hlinnaka/gpdb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hlinnaka/gpdb/teams","hooks_url":"https://api.github.com/repos/hlinnaka/gpdb/hooks","issue_events_url":"https://api.github.com/repos/hlinnaka/gpdb/issues/events{/number}","events_url":"https://api.github.com/repos/hlinnaka/gpdb/events","assignees_url":"https://api.github.com/repos/hlinnaka/gpdb/assignees{/user}","branches_url":"https://api.github.com/repos/hlinnaka/gpdb/branches{/branch}","tags_url":"https://api.github.com/repos/hlinnaka/gpdb/tags","blobs_url":"https://api.github.com/repos/hlinnaka/gpdb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hlinnaka/gpdb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hlinnaka/gpdb/git/refs{/sha}","trees_url":"https://api.github.com/repos/hlinnaka/gpdb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hlinnaka/gpdb/statuses/{sha}","languages_url":"https://api.github.com/repos/hlinnaka/gpdb/languages","stargazers_url":"https://api.github.com/repos/hlinnaka/gpdb/stargazers","contributors_url":"https://api.github.com/repos/hlinnaka/gpdb/contributors","subscribers_url":"https://api.github.com/repos/hlinnaka/gpdb/subscribers","subscription_url":"https://api.github.com/repos/hlinnaka/gpdb/subscription","commits_url":"https://api.github.com/repos/hlinnaka/gpdb/commits{/sha}","git_commits_url":"https://api.github.com/repos/hlinnaka/gpdb/git/commits{/sha}","comments_url":"https://api.github.com/repos/hlinnaka/gpdb/comments{/number}","issue_comment_url":"https://api.github.com/repos/hlinnaka/gpdb/issues/comments{/number}","contents_url":"https://api.github.com/repos/hlinnaka/gpdb/contents/{+path}","compare_url":"https://api.github.com/repos/hlinnaka/gpdb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hlinnaka/gpdb/merges","archive_url":"https://api.github.com/repos/hlinnaka/gpdb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hlinnaka/gpdb/downloads","issues_url":"https://api.github.com/repos/hlinnaka/gpdb/issues{/number}","pulls_url":"https://api.github.com/repos/hlinnaka/gpdb/pulls{/number}","milestones_url":"https://api.github.com/repos/hlinnaka/gpdb/milestones{/number}","notifications_url":"https://api.github.com/repos/hlinnaka/gpdb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hlinnaka/gpdb/labels{/name}","releases_url":"https://api.github.com/repos/hlinnaka/gpdb/releases{/id}","created_at":"2015-11-02T12:40:55Z","updated_at":"2015-11-02T12:41:40Z","pushed_at":"2016-01-11T20:18:25Z","git_url":"git://github.com/hlinnaka/gpdb.git","ssh_url":"git@github.com:hlinnaka/gpdb.git","clone_url":"https://github.com/hlinnaka/gpdb.git","svn_url":"https://github.com/hlinnaka/gpdb","homepage":"http://greenplum.org","size":121153,"stargazers_count":0,"watchers_count":0,"language":"PLpgSQL","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"greenplum-db:master","ref":"master","sha":"67b1f29ec28a909faf01e92e85e0cc1159437691","user":{"login":"greenplum-db","id":14097842,"avatar_url":"https://avatars.githubusercontent.com/u/14097842?v=3","gravatar_id":"","url":"https://api.github.com/users/greenplum-db","html_url":"https://github.com/greenplum-db","followers_url":"https://api.github.com/users/greenplum-db/followers","following_url":"https://api.github.com/users/greenplum-db/following{/other_user}","gists_url":"https://api.github.com/users/greenplum-db/gists{/gist_id}","starred_url":"https://api.github.com/users/greenplum-db/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/greenplum-db/subscriptions","organizations_url":"https://api.github.com/users/greenplum-db/orgs","repos_url":"https://api.github.com/users/greenplum-db/repos","events_url":"https://api.github.com/users/greenplum-db/events{/privacy}","received_events_url":"https://api.github.com/users/greenplum-db/received_events","type":"Organization","site_admin":false},"repo":{"id":44781140,"name":"gpdb","full_name":"greenplum-db/gpdb","owner":{"login":"greenplum-db","id":14097842,"avatar_url":"https://avatars.githubusercontent.com/u/14097842?v=3","gravatar_id":"","url":"https://api.github.com/users/greenplum-db","html_url":"https://github.com/greenplum-db","followers_url":"https://api.github.com/users/greenplum-db/followers","following_url":"https://api.github.com/users/greenplum-db/following{/other_user}","gists_url":"https://api.github.com/users/greenplum-db/gists{/gist_id}","starred_url":"https://api.github.com/users/greenplum-db/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/greenplum-db/subscriptions","organizations_url":"https://api.github.com/users/greenplum-db/orgs","repos_url":"https://api.github.com/users/greenplum-db/repos","events_url":"https://api.github.com/users/greenplum-db/events{/privacy}","received_events_url":"https://api.github.com/users/greenplum-db/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/greenplum-db/gpdb","description":"Greenplum Database","fork":false,"url":"https://api.github.com/repos/greenplum-db/gpdb","forks_url":"https://api.github.com/repos/greenplum-db/gpdb/forks","keys_url":"https://api.github.com/repos/greenplum-db/gpdb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/greenplum-db/gpdb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/greenplum-db/gpdb/teams","hooks_url":"https://api.github.com/repos/greenplum-db/gpdb/hooks","issue_events_url":"https://api.github.com/repos/greenplum-db/gpdb/issues/events{/number}","events_url":"https://api.github.com/repos/greenplum-db/gpdb/events","assignees_url":"https://api.github.com/repos/greenplum-db/gpdb/assignees{/user}","branches_url":"https://api.github.com/repos/greenplum-db/gpdb/branches{/branch}","tags_url":"https://api.github.com/repos/greenplum-db/gpdb/tags","blobs_url":"https://api.github.com/repos/greenplum-db/gpdb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/greenplum-db/gpdb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/greenplum-db/gpdb/git/refs{/sha}","trees_url":"https://api.github.com/repos/greenplum-db/gpdb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/greenplum-db/gpdb/statuses/{sha}","languages_url":"https://api.github.com/repos/greenplum-db/gpdb/languages","stargazers_url":"https://api.github.com/repos/greenplum-db/gpdb/stargazers","contributors_url":"https://api.github.com/repos/greenplum-db/gpdb/contributors","subscribers_url":"https://api.github.com/repos/greenplum-db/gpdb/subscribers","subscription_url":"https://api.github.com/repos/greenplum-db/gpdb/subscription","commits_url":"https://api.github.com/repos/greenplum-db/gpdb/commits{/sha}","git_commits_url":"https://api.github.com/repos/greenplum-db/gpdb/git/commits{/sha}","comments_url":"https://api.github.com/repos/greenplum-db/gpdb/comments{/number}","issue_comment_url":"https://api.github.com/repos/greenplum-db/gpdb/issues/comments{/number}","contents_url":"https://api.github.com/repos/greenplum-db/gpdb/contents/{+path}","compare_url":"https://api.github.com/repos/greenplum-db/gpdb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/greenplum-db/gpdb/merges","archive_url":"https://api.github.com/repos/greenplum-db/gpdb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/greenplum-db/gpdb/downloads","issues_url":"https://api.github.com/repos/greenplum-db/gpdb/issues{/number}","pulls_url":"https://api.github.com/repos/greenplum-db/gpdb/pulls{/number}","milestones_url":"https://api.github.com/repos/greenplum-db/gpdb/milestones{/number}","notifications_url":"https://api.github.com/repos/greenplum-db/gpdb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/greenplum-db/gpdb/labels{/name}","releases_url":"https://api.github.com/repos/greenplum-db/gpdb/releases{/id}","created_at":"2015-10-23T00:25:17Z","updated_at":"2016-01-11T18:53:02Z","pushed_at":"2016-01-11T23:51:13Z","git_url":"git://github.com/greenplum-db/gpdb.git","ssh_url":"git@github.com:greenplum-db/gpdb.git","clone_url":"https://github.com/greenplum-db/gpdb.git","svn_url":"https://github.com/greenplum-db/gpdb","homepage":"http://greenplum.org","size":121752,"stargazers_count":1254,"watchers_count":1254,"language":"PLpgSQL","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":288,"mirror_url":null,"open_issues_count":47,"forks":288,"open_issues":47,"watchers":1254,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/greenplum-db/gpdb/pulls/246"},"html":{"href":"https://github.com/greenplum-db/gpdb/pull/246"},"issue":{"href":"https://api.github.com/repos/greenplum-db/gpdb/issues/246"},"comments":{"href":"https://api.github.com/repos/greenplum-db/gpdb/issues/246/comments"},"review_comments":{"href":"https://api.github.com/repos/greenplum-db/gpdb/pulls/246/comments"},"review_comment":{"href":"https://api.github.com/repos/greenplum-db/gpdb/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/greenplum-db/gpdb/pulls/246/commits"},"statuses":{"href":"https://api.github.com/repos/greenplum-db/gpdb/statuses/fe0b383dcc17bd4afb511a5854d58f255b0a0879"}}}}