Re: BUG #3682: Incomplete database restore

From: "Heikki Linnakangas" <heikki(at)enterprisedb(dot)com>
To: "Gary Chambers" <gwchamb(at)gmail(dot)com>, "PostgreSQL Bugs" <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #3682: Incomplete database restore
Date: 2007-10-21 18:56:01
Message-ID: 471BA0C1.2070401@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

(please keep the list cc'd)

Gary Chambers wrote:
>> Ah, did you dump the database from an existing 8.2 installation? There's
>> clauses in there to create Postgres 8.2 contrib/tsearch2 types and
>> functions, which are no longer needed beacuse full-text search is now a
>> core feature. I removed them by hand, and after that it works.
>
> Indeed, I did. I thought there may be some trouble with that. I used
> pg_dumpall (from the 8.3beta1 source tree prior to installing) then
> performed (as the postgres user) a 'psql postgres < dumpall.sql'
> restore to the newly-installed 8.3b1 without error. I didn't start
> fearing my data's integrity until I noticed that the full-text
> searches on the Wiki failed. Thank goodness for development laptops
> to perform this kind of testing before upgrading production servers.
> :)
>
>> Note that you have to make a dump with pg_dump -Fc or -Ft option, the one you posted
>> doesn't work with the script.
>
> No luck. I am still receiving numerous invalid command errors. I
> tried with both -Fc and -Ft dump types. I tried both piping the
> output to psql and using psql to input the pg_restore output.
>
> You can find the newtoc file and another 8.2.4 database dump at:
> ...

Ok, thanks. I ran the script like this:
./removets2 wikidb.tar > newtoc
pg_restore -L newtoc wikidb.tar > wikidb-psql

Then I edited wikidb-psql, changing those "public.tsvector" datatypes to
just "tsvector". After that:
psql wikidb < wikidb-psql

And got no errors.

What should we do with the data type in the script? Currently it just
looks at the TOC, but that's not enough to search/replace
schema.tsvector to tsvector. Is it enough if we mention that in the
migration guide?

Perhaps we should include the functionality of that script in pg_dump.

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2007-10-21 20:24:05 Re: BUG #3682: Incomplete database restore
Previous Message Stavros Korokithakis 2007-10-21 14:35:07 BUG #3687: PL/Python is built against Python 2.4