Thread: error msg when pg_restore

error msg when pg_restore

From
"nuno"
Date:
good'ay everyone.

i have this problem which may not be a big deal, however, it'd be great
if you could help me if possible.

when i restore a database (using a backup file), it shows me some error
messages which do not seem to matter at all (there is no data lost in
the database, and maybe they're just warning messages...).

anyway, for example, my error messsages are like...
(error messages...)
pg_restore: [archiver (db)] Error from TOC entry 20; 1255 18499583
FUNCTION plpg
sql_validator(oid) postgres
pg_restore: [archiver (db)] could not execute query: ERROR:  function
public.plp
gsql_validator(oid) does not exist
    Command was: DROP FUNCTION public.plpgsql_validator(oid);
pg_restore: [archiver (db)] Error from TOC entry 19; 1255 18499582
FUNCTION plpg
sql_call_handler() postgres
(more error messages...)
WARNING: errors ignored on restore: 27

i have no idea why i had these errors. and i don't think they are
meaningful at all as i said earlied there is no data lost in the
database.

does anyone know how to turn this checking off so that i don't see
messages like them anymore.

thanks very much for your time.

regards, nuno


Re: error msg when pg_restore

From
Tom Lane
Date:
"nuno" <wegein@gmail.com> writes:
> when i restore a database (using a backup file), it shows me some error
> messages which do not seem to matter at all (there is no data lost in
> the database, and maybe they're just warning messages...).

> pg_restore: [archiver (db)] could not execute query: ERROR:  function
> public.plp
> gsql_validator(oid) does not exist
>     Command was: DROP FUNCTION public.plpgsql_validator(oid);

Apparently you're using the -c option when there's not really anything
that needs dropping.  -c is for removing existing copies of the database
objects you're restoring.

            regards, tom lane

Re: error msg when pg_restore

From
"nuno"
Date:
hi, there, tom. thank you for your help.

i turned -c off and now i find a less no. of errors, however, i still
get them!
(i used to have approx 70 'errors ignored on restore', now i have
approx 30 or even less than that).

one of errors is like below;

pg_restore: [archiver (db)] Error from TOC entry 18; 1255 17234
FUNCTION relatio
n_size(text) postgres
pg_restore: [archiver (db)] could not execute query: ERROR:  could not
access fi
le "$libdir/dbsize": No such file or directory
    Command was: CREATE FUNCTION relation_size(text) RETURNS bigint
    AS '$libdir/dbsize', 'relation_size'
    LANGUAGE c STRICT;

the options i am currently using are -i (ignore-version), -h (host), -d
(database), -U (user) and -W (password).

is there any way you can fix this problem?

thanks, nuno

Tom Lane wrote:
> "nuno" <wegein@gmail.com> writes:
> > when i restore a database (using a backup file), it shows me some error
> > messages which do not seem to matter at all (there is no data lost in
> > the database, and maybe they're just warning messages...).
>
> > pg_restore: [archiver (db)] could not execute query: ERROR:  function
> > public.plp
> > gsql_validator(oid) does not exist
> >     Command was: DROP FUNCTION public.plpgsql_validator(oid);
>
> Apparently you're using the -c option when there's not really anything
> that needs dropping.  -c is for removing existing copies of the database
> objects you're restoring.
>
>             regards, tom lane
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: Don't 'kill -9' the postmaster


Re: error msg when pg_restore

From
"nuno"
Date:
by the way, i had 3 different types of errors messages;

1. pg_restore: [archiver (db)] Error from TOC entry 17; 1255 17233
FUNCTION database_size(name)* postgres
2. pg_restore: [archiver (db)] could not execute query: ERROR: could
not access file "$libdir/dbsize"**: No such file or directory...
3. pg_restore: [archiver (db)] could not execute query: ERROR: function
public.database_size(name)*** does not exist...

* or pg_database_size(oid), pg_dir_ls(text, boolean),
pg_file_read(text, bigint, bigint), pg_file_stat(text), etc.
** or "$libdir/admin"
*** or public.pg_database_size(oid), public.pg_dir_ls(text, boolean),
etc.

every single message is one of the types specified above. i read the
posts about pg_restore, and i still haven't been able to figure it out.

any clue anyone?

nuno wrote:
> hi, there, tom. thank you for your help.
>
> i turned -c off and now i find a less no. of errors, however, i still
> get them!
> (i used to have approx 70 'errors ignored on restore', now i have
> approx 30 or even less than that).
>
> one of errors is like below;
>
> pg_restore: [archiver (db)] Error from TOC entry 18; 1255 17234
> FUNCTION relatio
> n_size(text) postgres
> pg_restore: [archiver (db)] could not execute query: ERROR:  could not
> access fi
> le "$libdir/dbsize": No such file or directory
>     Command was: CREATE FUNCTION relation_size(text) RETURNS bigint
>     AS '$libdir/dbsize', 'relation_size'
>     LANGUAGE c STRICT;
>
> the options i am currently using are -i (ignore-version), -h (host), -d
> (database), -U (user) and -W (password).
>
> is there any way you can fix this problem?
>
> thanks, nuno
>
> Tom Lane wrote:
> > "nuno" <wegein@gmail.com> writes:
> > > when i restore a database (using a backup file), it shows me some error
> > > messages which do not seem to matter at all (there is no data lost in
> > > the database, and maybe they're just warning messages...).
> >
> > > pg_restore: [archiver (db)] could not execute query: ERROR:  function
> > > public.plp
> > > gsql_validator(oid) does not exist
> > >     Command was: DROP FUNCTION public.plpgsql_validator(oid);
> >
> > Apparently you're using the -c option when there's not really anything
> > that needs dropping.  -c is for removing existing copies of the database
> > objects you're restoring.
> >
> >             regards, tom lane
> >
> > ---------------------------(end of broadcast)---------------------------
> > TIP 2: Don't 'kill -9' the postmaster


Re: error msg when pg_restore

From
Tom Lane
Date:
"nuno" <wegein@gmail.com> writes:
> pg_restore: [archiver (db)] could not execute query: ERROR:  could not
> access file "$libdir/dbsize": No such file or directory
>     Command was: CREATE FUNCTION relation_size(text) RETURNS bigint
>     AS '$libdir/dbsize', 'relation_size'
>     LANGUAGE c STRICT;

You haven't installed the "dbsize" module, which evidently existed in
your old installation.

[ checks around... ]  Actually, dbsize disappeared from contrib in 8.1
because the functions got integrated into the core (some under different
names than before).  So you should be able to just ignore those errors,
unless maybe some of your own objects like views depended on them.
In that case you'd have to recreate the view manually with a corrected
definition.

            regards, tom lane