Use single quotes around the truncation parameter.

(Assume future enums in DateTruncate will correspond to the postgres args).
This commit is contained in:
Ray Greenwell
2010-03-02 21:36:29 +00:00
parent cb86b6def4
commit 93d90083a1
@@ -97,8 +97,8 @@ public class PostgreSQLBuilder
@Override @Override
public Void visit (DateTruncate exp) public Void visit (DateTruncate exp)
{ {
// exp.getTruncation() is currently always DAY String field = "'" + exp.getTruncation().toString().toLowerCase() + "'";
return appendFunctionCall("date_trunc", Exps.literal("day"), exp.getArg()); return appendFunctionCall("date_trunc", Exps.literal(field), exp.getArg());
} }
protected String translateDatePart (Part part) protected String translateDatePart (Part part)