Skip to content

Conversation

@yaojiejia
Copy link
Contributor

Closes #1254


PostgresColumn column = columns.get(i);

if (Randomly.getBoolean() && sourceHasColumn(column, sourceTable)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are a couple of repeated code patterns here. It would be great to factor them out to methods.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep!

} else {
sb.append(generateUpdateSet(targetTable, sourceTable));
}
} catch (Exception e) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks a bit surprising. Why does throwing an exception affect the logic of what we generate here? Can we achieve the intended outcome without relying on exceptions?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PostgreSQL Version 15 Upgrade - Supporting MERGE Function

2 participants