-
Notifications
You must be signed in to change notification settings - Fork 686
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow users to create unique indexes #385
Conversation
Fixes #130 |
Hey @mtuncer: putting "Fixes" in a comment won't do anything. It needs to be in the pull request's description. I've added it there. |
@@ -563,7 +563,7 @@ ProcessAlterTableStmt(AlterTableStmt *alterTableStatement, const char *alterTabl | |||
* supported for distributed tables and errors out if it is not. | |||
*/ | |||
static void | |||
ErrorIfUnsupportedIndexStmt(IndexStmt *createIndexStatement) | |||
ErrorIfUnsupportedIndexStmt(Oid relationId, IndexStmt *createIndexStatement) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we don't have to pass relationId to the function. Index statement has RangeVar *relation
field. We can use RangeVarGetRelid()
to get the relationID.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. however it requires getting another lock. Which should be okay.
@mtuncer I added some comments to this PR. I'll do the testing after discussing the them. |
continue; | ||
} | ||
|
||
attributeNumber = get_attnum(relationId, columnName); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
get_attnum
returns InvalidOid
for dropped columns. We could detect it here, but, for DDL command propagation we prefer to get the error from the worker nodes as we do it for other error cases. I am noting it here for documentation purposes.
@mtuncer this looks good, also tested once more. Let's |
8bd9c3f
to
3c4dadc
Compare
Users can now create unique indexes on partition columns for hash and range distributed tables.
3c4dadc
to
e74decf
Compare
Allow users to create unique indexes
Users can now create unique indexes on partition columns for hash and range distributed tables.
Fixes #130