I am using jOOQ as a SQL builder and I try to build a simple update statement as the following:
DSL.using(SQLDialect.POSTGRES_9_5)
.update(table("Location"))
.set(field("speed"), 50)
.set(field("location"), "ST_PointFromText('POINT(-73 40)', 4326)")
.where(field("id").equal(1))
.getSQL(ParamType.INLINED);
As you can see, I am using Postgres and PostGIS, so I need to insert the location using the PostGIS method ST_PointFromText().
The generated SQL looks like this, and fails because the ST_PointFromText() is wrapped around single quotes:
update Location
set speed = 50, location = 'ST_PointFromText(''POINT(-73 40)'', 4326)'
where id = 1
The query should be:
update Location
set speed = 50, location = ST_PointFromText('POINT(-73 40)', 4326)
where id = 1
Is there any way to remove the quotes around the ST_PointFromText()?