By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,564 Members | 956 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,564 IT Pros & Developers. It's quick & easy.

tsearch2: restoring problem

P: n/a
Hi

I have a problem with the restoring of a database which uses tsearch2. I
made a backup as discribed in 'tsearch-v2-intro' on the tsearch2 page.
Now i'm trying to restore it into a testdatabase. The problem is, that
the entries of the relations 'pg_ts_cfg', 'pg_ts_cfgmap', 'pg_ts_dict'
and 'pg_ts_parser' are not correctly restored. I get errors like:

psql:restoretest.out:28223: ERROR: copy: line 1, Cannot insert a
duplicate key into unique index pg_ts_dict_pkey
psql:restoretest.out:28223: lost synchronization with server, resetting
connection
There should be made an additional entry for my german dicts. But it isn't.

Thanks for your help.

Ulrich


--
Ulrich G. Fischer Dipl. Natw. ETH
Center Aerodynamics Ruag Aerospace
P.O. Box 301 CH-6032 Emmen
Tel. +41 41 268 23 53 Fax. +41 41 268 38 97
ul************@aerodynamics.ch www.ruag.com
---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Nov 22 '05 #1
Share this Question
Share on Google+
2 Replies

P: n/a
Fischer Ulrich <ul************@aerodynamics.ch> writes:
I have a problem with the restoring of a database which uses tsearch2. I
made a backup as discribed in 'tsearch-v2-intro' on the tsearch2 page.
Now i'm trying to restore it into a testdatabase. The problem is, that
the entries of the relations 'pg_ts_cfg', 'pg_ts_cfgmap', 'pg_ts_dict'
and 'pg_ts_parser' are not correctly restored. I get errors like: psql:restoretest.out:28223: ERROR: copy: line 1, Cannot insert a
duplicate key into unique index pg_ts_dict_pkey


Guessing, but it kinda sounds like you are trying to restore into a
database that already contains tsearch2 support. If you've installed
tsearch2 into template1 then this is a likely gotcha, since the tsearch2
objects will propagate into any database cloned from template1. If
that's the problem then the answer is to create your database from
template0 instead of template1 before you run the restore. See the
CREATE DATABASE man page and/or the discussion of template databases in
the administrator's guide.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Nov 22 '05 #2

P: n/a
Tom Lane wrote:
Fischer Ulrich <ul************@aerodynamics.ch> writes:
I have a problem with the restoring of a database which uses tsearch2. I
made a backup as discribed in 'tsearch-v2-intro' on the tsearch2 page.
Now i'm trying to restore it into a testdatabase. The problem is, that
the entries of the relations 'pg_ts_cfg', 'pg_ts_cfgmap', 'pg_ts_dict'
and 'pg_ts_parser' are not correctly restored. I get errors like:


psql:restoretest.out:28223: ERROR: copy: line 1, Cannot insert a
duplicate key into unique index pg_ts_dict_pkey

Guessing, but it kinda sounds like you are trying to restore into a
database that already contains tsearch2 support. If you've installed
tsearch2 into template1 then this is a likely gotcha, since the tsearch2
objects will propagate into any database cloned from template1. If
that's the problem then the answer is to create your database from
template0 instead of template1 before you run the restore. See the
CREATE DATABASE man page and/or the discussion of template databases in
the administrator's guide.

regards, tom lane

Thanks for your help. I can't remember to install tsearch2 into
template1. But anyway, I used now template0 and got the same error. I've
just seen, when I load the schema.sql of my db that there is already
something wrong:

ERROR: ALTER TABLE / PRIMARY KEY multiple primary keys for table
'pg_ts_dict' are not allowed
ERROR: ALTER TABLE / PRIMARY KEY multiple primary keys for table
'pg_ts_parser' are not allowed
ERROR: ALTER TABLE / PRIMARY KEY multiple primary keys for table
'pg_ts_cfg' are not allowed
ERROR: ALTER TABLE / PRIMARY KEY multiple primary keys for table
'pg_ts_cfgmap' are not allowed

The input of tsearch2.sql runs error free. Bevor reading schema.sql, I
modified it like described in 'tsearch-v2-intro' (removing all tsearch2
relatet functions, data types and operators). Because of other errors
and because these four relations are already defined by tsearch2.sql, I
also removed their definition in schema.sql.

regards

Ulrich

--
Ulrich G. Fischer Dipl. Natw. ETH
Center Aerodynamics Ruag Aerospace
P.O. Box 301 CH-6032 Emmen
Tel. +41 41 268 23 53 Fax. +41 41 268 38 97
ul************@aerodynamics.ch www.ruag.com
---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Nov 22 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.