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
public Void visit (DateTruncate exp)
{
// exp.getTruncation() is currently always DAY
return appendFunctionCall("date_trunc", Exps.literal("day"), exp.getArg());
String field = "'" + exp.getTruncation().toString().toLowerCase() + "'";
return appendFunctionCall("date_trunc", Exps.literal(field), exp.getArg());
}
protected String translateDatePart (Part part)