Received: from localhost (unknown [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 273612E0186 for ; Sat, 12 Jan 2008 14:40:17 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 33392-05 for ; Sat, 12 Jan 2008 14:40:14 -0400 (AST) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id F155D2E00B1 for ; Sat, 12 Jan 2008 14:40:13 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.1/8.14.1) with ESMTP id m0CIeDtS016897; Sat, 12 Jan 2008 13:40:13 -0500 (EST) To: Andreas Haumer cc: pgsql-admin@postgresql.org Subject: Re: Restore dump into different databases/owners In-reply-to: <47890687.8030504@xss.co.at> References: <4788B647.1050600@xss.co.at> <4788EA09.4050808@xss.co.at> <9118.1200158125@sss.pgh.pa.us> <47890687.8030504@xss.co.at> Comments: In-reply-to Andreas Haumer message dated "Sat, 12 Jan 2008 19:27:19 +0100" Date: Sat, 12 Jan 2008 13:40:13 -0500 Message-ID: <16896.1200163213@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200801/135 X-Sequence-Number: 27909 Andreas Haumer writes: > Tom Lane schrieb: >> Exactly what problems did you have using "-O -U user" ? > So, the main problem is the call to > CREATE PROCEDURAL LANGUAGE plpgsql; > on the "mwdb" schema which contains all the tables, functions etc. Right. As of 8.3, the default permissions arrangement will allow database owners to create trusted procedural languages for themselves, so this dump would work for a non-superuser (though you'd still have to ignore the error from attempting to comment SCHEMA public --- I suppose we ought to look into keeping pg_dump from emitting that comment). Otherwise, the recommended procedure is for the superuser to load any required procedural languages when he makes the empty database. The database owner can take it from there. regards, tom lane