Обсуждение: how can I exclude stuff from template in my dumps?

Поиск
Список
Период
Сортировка

how can I exclude stuff from template in my dumps?

От
"Harald Armin Massa"
Дата:
hello,

on restoring dumps I get errors about languages and functions not
getting restored:

pg_restore: [Archivierer (DB)] Fehler in Inhaltsverzeichniseintrag 135; 1255 164
39 FUNCTION pldbg_step_over(integer) postgres
pg_restore: [Archivierer (DB)] could not execute query: FEHLER:  Funktion »pldb
g_step_over« existiert bereits mit den selben Argumenttypen
    Command was: CREATE FUNCTION pldbg_step_over(session integer) RETURNS breakp
oint
    AS '$libdir/pldbgapi', 'pldbg_step_over'
    LANGUAG...

of course ... pldbpg_step_over is allready present, as it is installed
by the setup of the template database and thatfore it is on every
database.

Same with procedural language pl/pgsql and pg_buffercache etc...

Result: pg_restore ignores 29 errors, which is harmless, as those
functions are allready present.

BUT: it would be nicer, to not have these errors, as they can
overshaddow REAL error messages within the output.

Is there a clever way to exclude them from dumps or restores?

Harald


--
GHUM Harald Massa
persuadere et programmare
Harald Armin Massa
Spielberger Straße 49
70435 Stuttgart
0173/9409607
no fx, no carrier pigeon
-
EuroPython 2009 will take place in Birmingham - Stay tuned!

Re: how can I exclude stuff from template in my dumps?

От
Tom Lane
Дата:
"Harald Armin Massa" <haraldarminmassa@gmail.com> writes:
> Is there a clever way to exclude them from dumps or restores?

You're thinking about it backwards.  The correct way to deal with this
is to create the destination database for the restore from template0,
so that it doesn't have any of template1's additions.

            regards, tom lane