Forum OpenACS Development: Re: acs_objects_context_object_un

Collapse
Posted by Dave Bauer on
Malte,

What exactly would you change?

The unique constraint is because of an index on (context_id,object_id).

Or rather the other way around.

"
-- The unique constriant about will force create of this index...
-- create index acs_objects_context_object_idx onacs_objects (context_id, object_id);
"

Point is, we can't change this, and I can't imagine why you would want to. What sort of transactions are failing due to this constraint? An example would be helpful.

Collapse
Posted by Malte Sussdorff on
The problem is described in https://openacs.org/forums/message-view?message%5fid=447214.

What I would change is to create the index and drop the unique constraint, as this seems to me to be the propper thing to do. But Dave explained that an index on (object_id,context_id) will create a unique constraint.

Now my question would be, why is that the case. But maybe I should ask over at postgresql. Any way how this could be detected? I mean if the database is creating a unique constraint, shouldn't this show up in \d ?