[ovirt-users] database restoration
Yedidyah Bar David
didi at redhat.com
Sun Feb 18 07:05:36 UTC 2018
On Fri, Feb 16, 2018 at 1:04 PM, Fabrice Bacchella
<fabrice.bacchella at orange.fr> wrote:
> I'm running a restoration test and getting the following log generated by engine-backup --mode=restore:
Which version?
Did you also get any error on stdout/stderr, or only in the log?
>
> pg_restore: [archiver (db)] Error while PROCESSING TOC:
> pg_restore: [archiver (db)] Error from TOC entry 4274; 0 0 COMMENT EXTENSION plpgsql
> pg_restore: [archiver (db)] could not execute query: ERROR: must be owner of extension plpgsql
> Command was: COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language';
>
>
>
> pg_restore: WARNING: no privileges could be revoked for "public"
> pg_restore: WARNING: no privileges could be revoked for "public"
> pg_restore: WARNING: no privileges were granted for "public"
> pg_restore: WARNING: no privileges were granted for "public"
> WARNING: errors ignored on restore: 1
>
> Do I need to worry, as this error is ignored ?
TL;DR no need to worry, can be ignored.
Details:
engine-backup has a specific set of errors it ignores.
You can search inside it for 'IGNORED_ERRORS' to see the list.
It _also_ logs the entire pg_restore output, just for reference.
(I also have a patch to log separately the list of errors not ignored:
https://gerrit.ovirt.org/86395
Need to find time to verify it, probably only in 4.3...)
This specific error happens due to the following:
PG by default creates new databases with the extension plpgsql.
This is good for us, as the engine needs it.
However, if you try to manually create this extension on some db,
you need admin permission for this - owning (e.g.) the db is not
enough.
When backing up the database, pg_dump dumps everything in it,
including commands to create this extension.
When engine-backup restores a database, it always uses only the
credentials of the engine db user, not postgres, thus (by default)
has no admin privs at this point. So this 'create' command fails,
and that's ok.
Best regards,
--
Didi
More information about the Users
mailing list