Forum OpenACS Q&A: Openfts Initialize Error : Relation 'txt' already exists

I've searched the OpenACS site and can't find a clear answer to this one. I've installed OpenACS 5.0.0 final, on a Redhat9 machine with Aolserver 4r2 and Postgresql 7.3.4. I get all the way to initializing the openfts drive and the results are: (I gather the txt table already exisits but I'm not sure who or what put it there first, I'm looking for a way to fix, or integrate openfts use of whatever it needs)
Database operation "dml" failed (exception ERROR, "ERROR:  Relation 'txt' already exists
")

ERROR:  Relation 'txt' already exists

SQL: create table txt ( tid int not null primary key, path varchar unique, fts_index txtidx, last_modified timestamp );
    while executing
"error "$err""
    invoked from within
"if [catch {
    db_dml create_table "create table $table_name ( ${table_id} int not null primary key, path varchar unique, fts_index txtidx, last_modi..."
    ("uplevel" body line 21)
    invoked from within
"uplevel {
    	  ad_page_contract {

    Initialize OpenFTS

    @author Neophytos Demetriou

} {
    table_name
    table_id
    dict
    numbergroup..."
    (procedure "code::tcl::/var/lib/aolserver/aso213/packages/openfts-driver..." line 2)
    invoked from within
"code::tcl::$__adp_stub"
    invoked from within
"if { [file exists $__adp_stub.tcl] } {

      # ensure that data source preparation procedure exists and is up-to-date
      adp_init tcl $__adp_stub
..."
    ("uplevel" body line 3)
    invoked from within
"uplevel {

    if { [file exists $__adp_stub.tcl] } {

      # ensure that data source preparation procedure exists and is up-to-date
      adp_init t..."
    (procedure "adp_prepare" line 2)
    invoked from within
"adp_prepare "
    (procedure "template::adp_parse" line 30)
    invoked from within
"template::adp_parse [file root [ad_conn file]] {}"
    (procedure "adp_parse_ad_conn_file" line 7)
    invoked from within
"$handler"
    ("uplevel" body line 2)
    invoked from within
"uplevel $code"
    invoked from within
"ad_try {
                $handler
            } ad_script_abort val {
                # do nothing
            }"
    invoked from within
"rp_serve_concrete_file [ad_conn file]"
    (procedure "rp_serve_abstract_file" line 60)
    invoked from within
"rp_serve_abstract_file "$root/$path""
    ("uplevel" body line 2)
    invoked from within
"uplevel $code"
    invoked from within
"ad_try {
	rp_serve_abstract_file "$root/$path"
	set tcl_url2file([ad_conn url]) [ad_conn file]
	set tcl_url2path_info([ad_conn url]) [ad_conn path_inf..."
Any help in correcting this is greatly appreciated. If I was using this installation on the internet I wouldn't bother, but I am behind a firewall where public search engines are not allowed to tread... Thanks,
Collapse
Posted by Tom Ayles on

I vaguely remembered having much the same problem at some point, and looking at my notes for OpenFTS installation I found this statement:

"Also may have to manually drop the txt table if it's been copied in from the template DB [template1], otherwise 'DML failed - relation txt already exists.'"

This is from about 6 months ago, so its not that fresh in my mind, but I think that if you follow the OpenFTS installation instructions and source openfts.sql into your database, it creates the txt table, and so you have to drop it before the driver can initialise properly. I can't offer any guarantee that this is the best possible action, but I seem to remember it working OK.

That's the ticket!

Thanks Tom...