[#7171] Support parsing ON CONFLICT DO (no constraint specification)

This commit is contained in:
lukaseder 2018-03-09 12:47:46 +01:00
parent dd2e6ada84
commit 3dcb32098e

View File

@ -1203,13 +1203,15 @@ final class ParserImpl implements Parser {
if (parseKeywordIf(ctx, "ON CONSTRAINT")) {
doUpdate = onDuplicate.onConflictOnConstraint(parseName(ctx));
}
else {
parse(ctx, '(');
else if (parseIf(ctx, '(')) {
doUpdate = onDuplicate.onConflict(parseFieldNames(ctx));
parse(ctx, ')');
}
parseKeyword(ctx, "DO");
else {
doUpdate = onDuplicate.onConflict();
}
parseKeyword(ctx, "DO");
if (parseKeywordIf(ctx, "NOTHING")) {
returning = doUpdate.doNothing();
}