if (args.size() == 2) {
return sequence("position",
groupedSequence(args.get(0), "in", args.get(1)));
}
else if (args.size() == 3) {
Node tmp = sequence("position",
groupedSequence(args.get(0), "in", "substring", groupedSequence(args.get(1), "from", args.get(2))));
return groupedSequence(args.get(2), grammar("*"), ident("sign"), groupedSequence(tmp), grammar("+"), tmp);
}
else {
throw new SQLException(GT.tr("{0} function takes two or three arguments.", "locate"), PSQLState.SYNTAX_ERROR);