{"action":"created","comment":{"url":"https://api.github.com/repos/citusdata/pg_shard/pulls/comments/24473038","id":24473038,"diff_hunk":"@@ -97,6 +106,35 @@ master_create_distributed_table(PG_FUNCTION_ARGS)\n \t\tereport(ERROR, (errmsg(\"unsupported partition method: %c\", partitionMethod)));\n \t}\n \n+\tpartitionColumnVar = ColumnNameToColumn(distributedTableId, partitionColumnName);\n+\tpartitionColumnTypeId = partitionColumnVar->vartype;\n+\tpartitionColumnOpClassId = GetDefaultOpClass(partitionColumnTypeId, BTREE_AM_OID);\n+\n+\t/* if there is no operator class for the partition column, error out */\n+\tif (partitionColumnOpClassId == InvalidOid)\n+\t{\n+\t\tereport(ERROR, (errcode(ERRCODE_WRONG_OBJECT_TYPE),\n+\t\t\t\t\t\terrmsg(\"cannot distribute relation: \\\"%s\\\"\", tableName),\n+\t\t\t\t\t\terrdetail(\"Column \\\"%s\\\" is not eligible to be the distribution \"\n+\t\t\t\t\t\t\t\t  \"column.\", partitionColumnName),\n+\t\t\t\t\t\terrhint(\"Try another column as the distribution column.\")));\n+\t}\n+\n+\tlessEqualOperatorId = GetOperatorByType(partitionColumnTypeId, BTREE_AM_OID,\n+\t\t\t\t\t\t\t\t\t\t\tBTLessEqualStrategyNumber);\n+\tgreaterEqualOperatorId =  GetOperatorByType(partitionColumnTypeId, BTREE_AM_OID,\n+\t\t\t\t\t\t\t\t\t\t\t\tBTGreaterEqualStrategyNumber);\n+\n+\t/* if partition column does not support <= and >= operators, error out*/\n+\tif (lessEqualOperatorId == InvalidOid ||  greaterEqualOperatorId == InvalidOid)","path":"create_shards.c","position":56,"original_position":56,"commit_id":"20b17d685940c888f95564b5b0a3dfd15c217a6a","original_commit_id":"20b17d685940c888f95564b5b0a3dfd15c217a6a","user":{"login":"jasonmp85","id":50673,"avatar_url":"https://avatars.githubusercontent.com/u/50673?v=3","gravatar_id":"","url":"https://api.github.com/users/jasonmp85","html_url":"https://github.com/jasonmp85","followers_url":"https://api.github.com/users/jasonmp85/followers","following_url":"https://api.github.com/users/jasonmp85/following{/other_user}","gists_url":"https://api.github.com/users/jasonmp85/gists{/gist_id}","starred_url":"https://api.github.com/users/jasonmp85/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jasonmp85/subscriptions","organizations_url":"https://api.github.com/users/jasonmp85/orgs","repos_url":"https://api.github.com/users/jasonmp85/repos","events_url":"https://api.github.com/users/jasonmp85/events{/privacy}","received_events_url":"https://api.github.com/users/jasonmp85/received_events","type":"User","site_admin":false},"body":"I believe this check only makes sense for tables that use range partitioning: for hash partitioning, the shards are always defined using 32-bit integers, and we can always find the inequality operator for that.\r\n\r\nIf using range partitioning, shard boundaries _will_ be defined using the partition column type, so it makes sense in that case to check for inequality operators.\r\n\r\nCan you change this section to do something like:\r\n\r\n```\r\nif using hash partitioning\r\n  check for presence of hash operator for partition column type\r\nelse if using range partitioning\r\n  check for existence of inequality operators for partition column type\r\nelse\r\n  error out that partition type is unexpected\r\n```","created_at":"2015-02-11T03:51:54Z","updated_at":"2015-02-11T03:51:54Z","html_url":"https://github.com/citusdata/pg_shard/pull/73#discussion_r24473038","pull_request_url":"https://api.github.com/repos/citusdata/pg_shard/pulls/73","_links":{"self":{"href":"https://api.github.com/repos/citusdata/pg_shard/pulls/comments/24473038"},"html":{"href":"https://github.com/citusdata/pg_shard/pull/73#discussion_r24473038"},"pull_request":{"href":"https://api.github.com/repos/citusdata/pg_shard/pulls/73"}}},"pull_request":{"url":"https://api.github.com/repos/citusdata/pg_shard/pulls/73","id":28804267,"html_url":"https://github.com/citusdata/pg_shard/pull/73","diff_url":"https://github.com/citusdata/pg_shard/pull/73.diff","patch_url":"https://github.com/citusdata/pg_shard/pull/73.patch","issue_url":"https://api.github.com/repos/citusdata/pg_shard/issues/73","number":73,"state":"open","locked":false,"title":"Feature issue#16","user":{"login":"onderkalaci","id":7829470,"avatar_url":"https://avatars.githubusercontent.com/u/7829470?v=3","gravatar_id":"","url":"https://api.github.com/users/onderkalaci","html_url":"https://github.com/onderkalaci","followers_url":"https://api.github.com/users/onderkalaci/followers","following_url":"https://api.github.com/users/onderkalaci/following{/other_user}","gists_url":"https://api.github.com/users/onderkalaci/gists{/gist_id}","starred_url":"https://api.github.com/users/onderkalaci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/onderkalaci/subscriptions","organizations_url":"https://api.github.com/users/onderkalaci/orgs","repos_url":"https://api.github.com/users/onderkalaci/repos","events_url":"https://api.github.com/users/onderkalaci/events{/privacy}","received_events_url":"https://api.github.com/users/onderkalaci/received_events","type":"User","site_admin":false},"body":"This pull request aims to prevent tables to be distributed with columns that cannot be used as distribution column.\r\n\r\nfixes #16","created_at":"2015-02-06T12:13:10Z","updated_at":"2015-02-11T03:51:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"47b15777f9442f3a4dbb31383f680025e6090352","assignee":{"login":"onderkalaci","id":7829470,"avatar_url":"https://avatars.githubusercontent.com/u/7829470?v=3","gravatar_id":"","url":"https://api.github.com/users/onderkalaci","html_url":"https://github.com/onderkalaci","followers_url":"https://api.github.com/users/onderkalaci/followers","following_url":"https://api.github.com/users/onderkalaci/following{/other_user}","gists_url":"https://api.github.com/users/onderkalaci/gists{/gist_id}","starred_url":"https://api.github.com/users/onderkalaci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/onderkalaci/subscriptions","organizations_url":"https://api.github.com/users/onderkalaci/orgs","repos_url":"https://api.github.com/users/onderkalaci/repos","events_url":"https://api.github.com/users/onderkalaci/events{/privacy}","received_events_url":"https://api.github.com/users/onderkalaci/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/citusdata/pg_shard/pulls/73/commits","review_comments_url":"https://api.github.com/repos/citusdata/pg_shard/pulls/73/comments","review_comment_url":"https://api.github.com/repos/citusdata/pg_shard/pulls/comments/{number}","comments_url":"https://api.github.com/repos/citusdata/pg_shard/issues/73/comments","statuses_url":"https://api.github.com/repos/citusdata/pg_shard/statuses/20b17d685940c888f95564b5b0a3dfd15c217a6a","head":{"label":"citusdata:feature-issue#16","ref":"feature-issue#16","sha":"20b17d685940c888f95564b5b0a3dfd15c217a6a","user":{"login":"citusdata","id":2545424,"avatar_url":"https://avatars.githubusercontent.com/u/2545424?v=3","gravatar_id":"","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":27522888,"name":"pg_shard","full_name":"citusdata/pg_shard","owner":{"login":"citusdata","id":2545424,"avatar_url":"https://avatars.githubusercontent.com/u/2545424?v=3","gravatar_id":"","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/pg_shard","description":"PostgreSQL extension to scale out real-time reads and writes. Check out the mailing list at https://groups.google.com/group/pg_shard-users or read the docs at http://citusdata.com/docs/pg-shard","fork":false,"url":"https://api.github.com/repos/citusdata/pg_shard","forks_url":"https://api.github.com/repos/citusdata/pg_shard/forks","keys_url":"https://api.github.com/repos/citusdata/pg_shard/keys{/key_id}","collaborators_url":"https://api.github.com/repos/citusdata/pg_shard/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/citusdata/pg_shard/teams","hooks_url":"https://api.github.com/repos/citusdata/pg_shard/hooks","issue_events_url":"https://api.github.com/repos/citusdata/pg_shard/issues/events{/number}","events_url":"https://api.github.com/repos/citusdata/pg_shard/events","assignees_url":"https://api.github.com/repos/citusdata/pg_shard/assignees{/user}","branches_url":"https://api.github.com/repos/citusdata/pg_shard/branches{/branch}","tags_url":"https://api.github.com/repos/citusdata/pg_shard/tags","blobs_url":"https://api.github.com/repos/citusdata/pg_shard/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/citusdata/pg_shard/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/citusdata/pg_shard/git/refs{/sha}","trees_url":"https://api.github.com/repos/citusdata/pg_shard/git/trees{/sha}","statuses_url":"https://api.github.com/repos/citusdata/pg_shard/statuses/{sha}","languages_url":"https://api.github.com/repos/citusdata/pg_shard/languages","stargazers_url":"https://api.github.com/repos/citusdata/pg_shard/stargazers","contributors_url":"https://api.github.com/repos/citusdata/pg_shard/contributors","subscribers_url":"https://api.github.com/repos/citusdata/pg_shard/subscribers","subscription_url":"https://api.github.com/repos/citusdata/pg_shard/subscription","commits_url":"https://api.github.com/repos/citusdata/pg_shard/commits{/sha}","git_commits_url":"https://api.github.com/repos/citusdata/pg_shard/git/commits{/sha}","comments_url":"https://api.github.com/repos/citusdata/pg_shard/comments{/number}","issue_comment_url":"https://api.github.com/repos/citusdata/pg_shard/issues/comments/{number}","contents_url":"https://api.github.com/repos/citusdata/pg_shard/contents/{+path}","compare_url":"https://api.github.com/repos/citusdata/pg_shard/compare/{base}...{head}","merges_url":"https://api.github.com/repos/citusdata/pg_shard/merges","archive_url":"https://api.github.com/repos/citusdata/pg_shard/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/citusdata/pg_shard/downloads","issues_url":"https://api.github.com/repos/citusdata/pg_shard/issues{/number}","pulls_url":"https://api.github.com/repos/citusdata/pg_shard/pulls{/number}","milestones_url":"https://api.github.com/repos/citusdata/pg_shard/milestones{/number}","notifications_url":"https://api.github.com/repos/citusdata/pg_shard/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/citusdata/pg_shard/labels{/name}","releases_url":"https://api.github.com/repos/citusdata/pg_shard/releases{/id}","created_at":"2014-12-04T04:24:37Z","updated_at":"2015-02-09T18:02:24Z","pushed_at":"2015-02-06T20:00:41Z","git_url":"git://github.com/citusdata/pg_shard.git","ssh_url":"git@github.com:citusdata/pg_shard.git","clone_url":"https://github.com/citusdata/pg_shard.git","svn_url":"https://github.com/citusdata/pg_shard","homepage":"","size":2497,"stargazers_count":619,"watchers_count":619,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":22,"mirror_url":null,"open_issues_count":38,"forks":22,"open_issues":38,"watchers":619,"default_branch":"develop"}},"base":{"label":"citusdata:develop","ref":"develop","sha":"036e3a8969ce19d862b71680134e54d1134ef8ec","user":{"login":"citusdata","id":2545424,"avatar_url":"https://avatars.githubusercontent.com/u/2545424?v=3","gravatar_id":"","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":27522888,"name":"pg_shard","full_name":"citusdata/pg_shard","owner":{"login":"citusdata","id":2545424,"avatar_url":"https://avatars.githubusercontent.com/u/2545424?v=3","gravatar_id":"","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/pg_shard","description":"PostgreSQL extension to scale out real-time reads and writes. Check out the mailing list at https://groups.google.com/group/pg_shard-users or read the docs at http://citusdata.com/docs/pg-shard","fork":false,"url":"https://api.github.com/repos/citusdata/pg_shard","forks_url":"https://api.github.com/repos/citusdata/pg_shard/forks","keys_url":"https://api.github.com/repos/citusdata/pg_shard/keys{/key_id}","collaborators_url":"https://api.github.com/repos/citusdata/pg_shard/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/citusdata/pg_shard/teams","hooks_url":"https://api.github.com/repos/citusdata/pg_shard/hooks","issue_events_url":"https://api.github.com/repos/citusdata/pg_shard/issues/events{/number}","events_url":"https://api.github.com/repos/citusdata/pg_shard/events","assignees_url":"https://api.github.com/repos/citusdata/pg_shard/assignees{/user}","branches_url":"https://api.github.com/repos/citusdata/pg_shard/branches{/branch}","tags_url":"https://api.github.com/repos/citusdata/pg_shard/tags","blobs_url":"https://api.github.com/repos/citusdata/pg_shard/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/citusdata/pg_shard/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/citusdata/pg_shard/git/refs{/sha}","trees_url":"https://api.github.com/repos/citusdata/pg_shard/git/trees{/sha}","statuses_url":"https://api.github.com/repos/citusdata/pg_shard/statuses/{sha}","languages_url":"https://api.github.com/repos/citusdata/pg_shard/languages","stargazers_url":"https://api.github.com/repos/citusdata/pg_shard/stargazers","contributors_url":"https://api.github.com/repos/citusdata/pg_shard/contributors","subscribers_url":"https://api.github.com/repos/citusdata/pg_shard/subscribers","subscription_url":"https://api.github.com/repos/citusdata/pg_shard/subscription","commits_url":"https://api.github.com/repos/citusdata/pg_shard/commits{/sha}","git_commits_url":"https://api.github.com/repos/citusdata/pg_shard/git/commits{/sha}","comments_url":"https://api.github.com/repos/citusdata/pg_shard/comments{/number}","issue_comment_url":"https://api.github.com/repos/citusdata/pg_shard/issues/comments/{number}","contents_url":"https://api.github.com/repos/citusdata/pg_shard/contents/{+path}","compare_url":"https://api.github.com/repos/citusdata/pg_shard/compare/{base}...{head}","merges_url":"https://api.github.com/repos/citusdata/pg_shard/merges","archive_url":"https://api.github.com/repos/citusdata/pg_shard/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/citusdata/pg_shard/downloads","issues_url":"https://api.github.com/repos/citusdata/pg_shard/issues{/number}","pulls_url":"https://api.github.com/repos/citusdata/pg_shard/pulls{/number}","milestones_url":"https://api.github.com/repos/citusdata/pg_shard/milestones{/number}","notifications_url":"https://api.github.com/repos/citusdata/pg_shard/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/citusdata/pg_shard/labels{/name}","releases_url":"https://api.github.com/repos/citusdata/pg_shard/releases{/id}","created_at":"2014-12-04T04:24:37Z","updated_at":"2015-02-09T18:02:24Z","pushed_at":"2015-02-06T20:00:41Z","git_url":"git://github.com/citusdata/pg_shard.git","ssh_url":"git@github.com:citusdata/pg_shard.git","clone_url":"https://github.com/citusdata/pg_shard.git","svn_url":"https://github.com/citusdata/pg_shard","homepage":"","size":2497,"stargazers_count":619,"watchers_count":619,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":22,"mirror_url":null,"open_issues_count":38,"forks":22,"open_issues":38,"watchers":619,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/citusdata/pg_shard/pulls/73"},"html":{"href":"https://github.com/citusdata/pg_shard/pull/73"},"issue":{"href":"https://api.github.com/repos/citusdata/pg_shard/issues/73"},"comments":{"href":"https://api.github.com/repos/citusdata/pg_shard/issues/73/comments"},"review_comments":{"href":"https://api.github.com/repos/citusdata/pg_shard/pulls/73/comments"},"review_comment":{"href":"https://api.github.com/repos/citusdata/pg_shard/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/citusdata/pg_shard/pulls/73/commits"},"statuses":{"href":"https://api.github.com/repos/citusdata/pg_shard/statuses/20b17d685940c888f95564b5b0a3dfd15c217a6a"}}}}