X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=dbscripts%2Fdupetrigger%2FINSTALL;h=e07b3e91b91d379d1b8eaaace564beea4895a17d;hb=6964bc916fce4e24e6b528dfaf020c3c1d8aec69;hp=8571231fa23ef20ae0222c90252de20f18f7de86;hpb=f8f567cff5e18bfaa09ed8757783803a5a160050;p=mir.git diff --git a/dbscripts/dupetrigger/INSTALL b/dbscripts/dupetrigger/INSTALL index 8571231f..e07b3e91 100755 --- a/dbscripts/dupetrigger/INSTALL +++ b/dbscripts/dupetrigger/INSTALL @@ -1,9 +1,48 @@ +The dupetrigger + +MOTIVATION + +Often, users commit their comments and articles multiple times if they +don't believe the comment has been inserted into the databases. This is +clearly one of the disadvantages of the otherwise clever caching strategy +used by Mir. Without proper handling, this duplicate content will enlarge +the database and make the appearance of the generated web pages be less +satisfactory. + + +SOLUTIONS + +There are two approaches to get rid of these duplicate entries +(hereafter called "dupes"). The first approach is the dupetrigger that +ensures that no entries in a given table are the same. This is the approach +currently pursued in Mir. If this trigger cannot be compiled or doesn't work +for any reason, you may work-around this problem by issuing the following +commands on your psql prompt: + +CREATE UNIQUE INDEX idx_content_dupe ON content (title, subtitle, creator, description, content_data); +CREATE UNIQUE INDEX idx_comment_dupe ON comment (creator, to_media, description, title); + +Please note that this approach will work but the implications on the Mir +software have not been tested, yet. Maybe Mir will respond with an error +or with other unexpected behaviour, but it should do no harm to the +database. The dupetrigger has been tested with Mir and is currently being +operated on de.indymedia.org. + + +HOW TO INSTALL THE DUPE TRIGGER + To install the trigger do the following: +# cp Makefile-dist Makefile + +# edit Makefile +(and change pathnames and PGVERSION if neccessary). + # make -(This makes the trigger binary and places it in /tmp with permissions 644) +(This makes the trigger binary and places it in INSTALLDIR with permissions 644) -# psql -U postgres Mir < postgresql.script -(This installs the the trigger binary and creates a new trigger.) +# edit postgresql.script +(And change the path to dupetrigger.so to INSTALLDIR) -# rm /tmp/trigger.so +# psql -Upostgres -f postgresql.script Mir +(This installs the the trigger binary and creates a new trigger.)