Re: [GENERAL] 9.0: plpgsql eror when restoring a database as a non superuser

2011-10-22 Thread Adrian Klaver
On Saturday, October 22, 2011 12:06:25 pm stefan wrote: > >> Therefore the only solution I see is to drop plpgsql from template1, or > >> writing a wrapper script that exploits the -l and -L options of > >> pg_restore. > > > > Yes. Though I could see an option to create a template database without

Re: [GENERAL] 9.0: plpgsql eror when restoring a database as a non superuser

2011-10-22 Thread stefan
On 22-10-11 18:21, Tom Lane wrote: Or just ignore the error during restore. Hi Tom, for a manual restore I could just live with that, but this is a semi automated setup and we feel very strongly about acting on pg_restore's exit code. Cheers, Stefan. -- Sent via pgsql-general mailing

Re: [GENERAL] 9.0: plpgsql eror when restoring a database as a non superuser

2011-10-22 Thread stefan
Therefore the only solution I see is to drop plpgsql from template1, or writing a wrapper script that exploits the -l and -L options of pg_restore. Yes. Though I could see an option to create a template database without plpgsql in it for use by non-superuser users and leave template1 as is. A

Re: [GENERAL] 9.0: plpgsql eror when restoring a database as a non superuser

2011-10-22 Thread Adrian Klaver
On Saturday, October 22, 2011 8:33:01 am stefan wrote: > > Thank you, Adrian for your response. > > I have checked your suggestion: in pg_pltemplate, tmpldbacreate is set > to true. As you state above, this allows a non superuser to create the > language in any database that does not yet has tha

Re: [GENERAL] 9.0: plpgsql eror when restoring a database as a non superuser

2011-10-22 Thread Tom Lane
stefan writes: > However, due to the fact that in 9.0, the language is in template1 and > owned by postgres, a non superuser database owner will not have the > right to create or replace this language in any newly created database > owned by himself. True. > Therefore the only solution I see

Re: [GENERAL] 9.0: plpgsql eror when restoring a database as a non superuser

2011-10-22 Thread stefan
On 22-10-11 16:12, Adrian Klaver wrote: On Saturday, October 22, 2011 2:12:14 am stefan wrote: pg_restore: [archiver (db)] could not execute query: ERROR: must be owner of language plpgsql Command was: CREATE OR REPLACE PROCEDURAL LANGUAGE plpgsql; Is there a way that this error can be

Re: [GENERAL] 9.0: plpgsql eror when restoring a database as a non superuser

2011-10-22 Thread Adrian Klaver
On Saturday, October 22, 2011 2:12:14 am stefan wrote: > 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: >