Forum OpenACS Development: Re: Res: Re: I can't find the error in MyFirstPackage

Collapse
Posted by Jim Lynch on
mfp_notesi is this weird view that if you insert into it, it does all the rest of the stuff needed (make an acs_object, etc) to get the new item in there.

Unfortunately...

doing that insert makes the -result- appear to be a "select" statement because of what the view is an "alias" for.

If you enable the debugging output of the nspostgres driver in the pool definition, it should show you what symbol is being returned by the pq exec call; you should fnd it's claiming there is a rows result.

So if you change the db_dml to soemthing else, like db_exec_plsql maybe, or maybe db_0or1row or db_string, the insert (which stops looking like an insert at the point of return) will return good exit status again.

Collapse
Posted by Brian Fenton on
You can insert into a view? Is this a Postgres "feature"?
You could try inserting into the underlying base tables directly.

Brian

Collapse
Posted by Jim Lynch on
The act of inserting into this particular view fires a trigger. This is a feature of the openacs content repository: when you create a content type, it makes a view with a trigger like this.
Jim, thanks, I get to run the example.