I use SQL Workbench with PostgreSQL and several times I face the same problem, but could not find solutions:
2013-10-29 14:45 ERROR Error executing statement UPDATE filial SET su = ? WHERE osb = ? AND filial = ? ERROR: column "su" is of type time_interval but expression is of type character varying
Hint: You will need to rewrite or cast the expression.
Position: 24 [SQL State=42804]
org.postgresql.util.PSQLException: ERROR: column "su" is of type time_interval but expression is of type character varying
Hint: You will need to rewrite or cast the expression.
Position: 24
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2157)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1886)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:255)
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:555)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:417)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:363)
at workbench.storage.DmlStatement.execute(DmlStatement.java:175)
at workbench.storage.DataStore.executeGuarded(DataStore.java:1636)
at workbench.storage.DataStore.updateDb(DataStore.java:1744)
at workbench.gui.sql.DwPanel.saveChanges(DwPanel.java:468)
at workbench.gui.sql.SqlPanel.updateDb(SqlPanel.java:1154)
at workbench.gui.sql.SqlPanel$4.run(SqlPanel.java:1133)
The obvious solution - to specify a value in single quotes:
UPDATE filial
SET su = '(08:30:00, 19:00:00)'
WHERE osb = 8558
AND filial = 3;
This work even without typecast (at least for PostgreSQL), when entered manually, but is there a way to do this automatically?
Version of SQL Workbench - last Build 115 (2013-09-01)
JDBC4 Postgresql Driver, Version 9.2-1003
Did anyone have the same problem and is there any solution?