Forum OpenACS Development: Re: Error in a psql function execution

Collapse
Posted by Tilmann Singer on
Pol, first of all you need to find the real database error. The stuff after the first lines of the error you posted is not informative, it's just a tcl stacktrace. To find the real error do a 'tail -f /path/to/your/logfile', reproduce the error and then scroll up - above of 'Database operation "0or1row" failed' you should find some more interesting message from postgresql, which will tell you about the real problem here.

I believe that a more recent nspostgresql driver would show the relevant error conveniently in the browser.

To find out your postgresql version you could do for example:

$ psql yourdbname
yourdbname=# select version();
Looking at the plpgsql you posted I see an error with this non-legal sql:
 insert into cads_categories
  (category_id, short_name, p_description, p_domain_id);
Are you sure you created the cads_category__new successfully and you can execute it manually from psql?
Collapse
Posted by Pol Vilarmau on
Thanks for all Tilmann!

The error was the simple insert query!

The cads_category__new function, was created successfully with the error instead! It's normal?

Anyway, i drop it and create it again.

Before i remove it, i tried to view the error again in the error.log file but the result was the same that i obtain through the browser.

Tanks again for all,

  Pol Vilarmau