Skip site navigation (1) Skip section navigation (2)

9.0: plpgsql eror when restoring a database as a non superuser

From: stefan <stefan(at)therp(dot)nl>
To: pgsql-general(at)postgresql(dot)org
Subject: 9.0: plpgsql eror when restoring a database as a non superuser
Date: 2011-10-22 09:12:14
Message-ID: j7u1df$ul2$1@dough.gmane.org (view raw, whole thread or download thread mbox)
Thread:
Lists: pgsql-general
Hi,

we run a setup with multiple non superusers who have the option of 
restoring their databases in a semi-automated fashion.

In 9.0, we run into the following error:

pg_restore: [archiver (db)] Error while PROCESSING TOC: 
 

pg_restore: [archiver (db)] Error from TOC entry 1038; 2612 11574 
PROCEDURAL LANGUAGE plpgsql postgres 

pg_restore: [archiver (db)] could not execute query: ERROR:  must be 
owner of language plpgsql 

    Command was: CREATE OR REPLACE PROCEDURAL LANGUAGE plpgsql;

Pg_restore thus returns an error value, causing trouble in our procedures.

In its simplest form, the error can be reproduced as follows:

createdb test
pg_dump -Fc test > test.psql
pg_restore -d test < test.psql

The database is created on the same postgresql server as on which it is 
restored. It is therefore no upgrade issue, as in this thread: 
http://archives.postgresql.org/pgsql-general/2010-12/msg00499.php

Is there a way that this error can be prevented when restoring a 
database as a non superuser?

I am already aware of a workaround using -l and -L, but I would strongly 
prefer the elegance of letting the bare psql tools do their job properly.

Cheers,
Stefan.


Responses

pgsql-general by date

Next:From: miesiDate: 2011-10-22 12:40:19
Subject: Re: Anyone using the solaris 11 precompiled binaries on opensolaris snv_134
Previous:From: Devrim GÜNDÜZDate: 2011-10-22 08:44:48
Subject: Re: Anyone using the solaris 11 precompiled binaries on opensolaris snv_134

Privacy Policy | About PostgreSQL
Copyright © 1996-2018 The PostgreSQL Global Development Group