id,summary,reporter,owner,description,type,status,priority,component,severity,resolution,keywords,cc,release 8952,Plugin not working due to table schema constraints,mrctrevisan,yosiyuki,"Hi all, I downloaded '''bookmarkplugin-!r10380.zip''', created the egg file and uploaded it to my Trac 0.12 instance (using postgresql 8.3, python 2.5 on linux debian lenny). I then run ""trac-admin ''trac-env-path'' update"" as suggested by the plugin's post install message and added to my trac user the bookmark related privileges. When I tried to add a bookmark, the ""*"" link was apparently inactive (when pressed it did nothing), so '''I wasn't able to add a bookmark'''. After some investigation (i.e. open the ""*"" link target into a new page and see Postgresql complaining about the ""name"" column being not null but a null value is supplied) I finally found out that the table ""bookmarks"" has a pk made of 3 columns: {{{ trac=# \d bookmarks Table ""public.bookmarks"" Column | Type | Modifiers ----------+------+----------- resource | text | not null name | text | not null username | text | not null Indexes: ""bookmarks_pk"" PRIMARY KEY, btree (resource, name, username) }}} but the plugin's code on insert is as follows: {{{ #!python def set_bookmark(self, req, resource): """"""Bookmark a resource."""""" # resource = self.normalise_resource(resource) if self.get_bookmark(req, resource): return db = self.env.get_db_cnx() cursor = db.cursor() cursor.execute('INSERT INTO bookmarks (resource, username) ' 'VALUES (%s, %s)', (resource, get_reporter_id(req))) db.commit() }}} If I run the following SQL script, the plugin starts working as expected: {{{ #!sql alter TABLE bookmarks drop constraint bookmarks_pk; alter TABLE bookmarks add primary key (resource,username); alter table bookmarks ALTER name DROP not null; }}} The plugin code doesn't seem to be up to date with the table design, or the table design seems too strongly constrained. Cheers, Marco ",defect,new,normal,BookmarkPlugin,major,,,,0.12