Forum OpenACS Development: Duplicate Key Error

Collapse
Posted by Sid Widge on
I have been getting this error for quite a while, does some one know why? ERROR: Cannot insert a duplicate key into unique index acs_object_types_pk
create function inline_7 ()
returns integer as'
declare
  attr_id            integer;
begin
  PERFORM content_type__create_type (
		''cr_wp_attachment'',
		''content_revision'',
		''Wimpy Attachment'',
		''Wimpy Attachments'',
		''cr_wp_attachments'',
		''attach_id'',
		null 
  );

PERFORM  attr_id := content_type__create_attribute (
	     ''cr_wp_attachment'',
	     ''display'',
	     ''text'',
	     ''Where to display'',
	     ''Where to display'',
	     null,		   
	     null,		   
	     ''varchar(20)''
  );
return 0;
end;' language 'plpgsql';