Re: problem with restore of functions - Mailing list pgsql-hackers

From Thomas T. Thai
Subject Re: problem with restore of functions
Date
Msg-id Pine.NEB.4.43.0203030143480.1138-100000@ns01.minnesota.com
Whole thread Raw
In response to Re: problem with restore of functions  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Fri, 22 Feb 2002, Tom Lane wrote:

> Oleg Bartunov <oleg@sai.msu.su> writes:
> > Sorry, I meant when we use contrib module, for example 'tsearch',
> > it creates functions, defines op_classes for 'gist_txtidx_ops',
> > which use OID of that functions.
> > pg_dump doesn't dumps op_clasess and it's impossible to use pg_restore.
>
> So the real gripe is that pg_dump doesn't dump user-defined opclasses.
> That's a fair complaint.  Submit a patch ;-)

the only way i got around this was to:

pg_dump -f filename dbname

then either load all those user defined opclasses in template1, then
create the db where it will automatically create all those templates. or
create the dbname and load in those opclasses (tsearch.sql) etc.

then do restore (not with pg_restore) but with:

psql -f filename dbname  (remember to create the db and make sure the
user functions are loaded first)

there will be errors about function blah blah already existing, in
addition to the db already existing. but your db should be ok.

not the most elegant or fastest way, but that's the only way i found it to
work. i couldn't find away to use pg_dump -Fc... and pg_restore :(

--
Thomas T. Thai
Minnesota.com, Inc.





pgsql-hackers by date:

Previous
From: Neil Conway
Date:
Subject: new hashing function
Next
From: Michael Meskes
Date:
Subject: Re: Oracle vs PostgreSQL in real life : NEWS!!!