Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 51D922EE4E0 for ; Fri, 13 Jan 2012 03:13:09 -0400 (AST) Received: from sd-17937.dedibox.fr ([88.191.100.74]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1RlbJw-0002z7-8q for pgsql-admin@postgresql.org; Fri, 13 Jan 2012 07:13:09 +0000 Received: from [192.168.10.3] (AMontsouris-552-1-157-70.w86-212.abo.wanadoo.fr [86.212.80.70]) by sd-17937.dedibox.fr (Postfix) with ESMTPA id 9C2BC3B945; Fri, 13 Jan 2012 08:14:39 +0100 (CET) Message-ID: <1326438770.2308.0.camel@localhost.localdomain> Subject: Re: Create & Alter Schema Permissions for a Login role in Postgresql database From: Guillaume Lelarge To: Tripura Cc: pgsql-admin@postgresql.org Date: Fri, 13 Jan 2012 08:12:50 +0100 In-Reply-To: <1326224017914-5135000.post@n5.nabble.com> References: <1326224017914-5135000.post@n5.nabble.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.2.2 (3.2.2-1.fc16) Content-Transfer-Encoding: 7bit Mime-Version: 1.0 X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201201/51 X-Sequence-Number: 38963 On Tue, 2012-01-10 at 11:33 -0800, Tripura wrote: > I have a Postgresql database with 3 Schemas (2 user defined and 1 public). > > I have script that takes backup of the user defined schema's and then drops > the schema's. > > Now after doing some operations I want to restore the user defined schemas > from the schema backup(schema_backup.out). > > When I execute > cat schema_backup.out | psql xx_db_name_xx > > I am getting the following error message > ERROR: permission denied for database xx_db_name_xx > ERROR: schema "aaaa" does not exist > ERROR: permission denied for database xx_db_name_xx > ERROR: schema "bbbb" does not exist > ERROR: must be owner of database xx_db_name_xx > > When I execute the same command as Admin user its executing just fine. But, > when I execute as a 'xxxxxx' user its failing. > > Can someone guide me, what permissions/rights should be added to 'xxxxxx' to > restore the schema? > He needs CREATE permission on the database. -- Guillaume http://blog.guillaume.lelarge.info http://www.dalibo.com PostgreSQL Sessions #3: http://www.postgresql-sessions.org