Forum OpenACS Development: Re: acs_object_id_seq creation speed

Collapse
Posted by Guan Yang on
I believe that the view exists so that you can call acs_object_id_seq.nextval.
Collapse
Posted by Sean Redmond on

I believe that the view exists so that you can call acs_object_id_seq.nextval.

This needs to be documented better, i.e. somewhere, probably as part of the ad_form documentation. It will bite anyone trying to use ad_form to insert records into a table where the primary key is a sequence but not acs_object_id_seq.

ad_form tries to call yourtable_id.nextval when it inserts a new record and it will it will crash until you dig through the code, discover this trick and define yourtable_id_seq accordingly.

Collapse
Posted by Andrew Piskorski on
Why does ad_form implicitly assume a particular style of sequence name at all? Why doesn't it just require that the programmer tell it what sequence to use?