Forum OpenACS Q&A: Postgresql server error when inserting new data

I get the following error message when I try to insert data in the table created by the package. It says that the query is malformed, but I can see where is the problem.

Database operation "dml" failed (exception NSDB, "Query was not a DML or DDL command.")

SQL:
INSERT INTO pruebai (item_id, revision_id, nombre, apellidos, fecha_nacimiento,
direccion, telefono, email, comentarios)
VALUES ('7492', '7494', 'asdf', 'asdf', '15/6/1975', 'asdf',
'458585965', 'mailto:asdf@asdf.com';, 'asdf')

Thanks in advance for your help.

Collapse
Posted by Derick Leony on
An INSERT into a CR view has a trigger attached to it, so it's rewritten into a SELECT.

The quick fix is to use db_0or1row instead of db_dml, but the best solution is to use the CR Tcl procs, content::revision::new in this case.