Received: from imag.imag.fr (imag.imag.fr [129.88.30.1]) by postgresql.org (Postfix) with ESMTP id 5191D47546E for ; Thu, 25 Jul 2002 13:25:26 -0400 (EDT) Received: from ormelune.imag.fr (ormelune.imag.fr [129.88.43.35]) by imag.imag.fr (8.11.6/8.11.6) with ESMTP id g6PHPPV15709; Thu, 25 Jul 2002 19:25:25 +0200 (MEST) Received: from astazou.imag.fr (astazou [129.88.43.102]) by ormelune.imag.fr (8.10.2+Sun/jtpda-5.3.3) with SMTP id g6PHPOT22763 ; Thu, 25 Jul 2002 19:25:24 +0200 (MET DST) To: pgsql-admin@postgresql.org Subject: database ownership and dumps X-Face: #v^9{p"~.e3TDs~r\ Date: Thu, 25 Jul 2002 19:25:24 +0200 Message-ID: Lines: 47 User-Agent: Gnus/5.090007 (Oort Gnus v0.07) XEmacs/21.1 (Capitol Reef, i386-debian-linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Archive-Number: 200207/361 X-Sequence-Number: 5045 Hello. We use PostgreSQL 7.1.3 on Debian GNU/Linux. I would like to 1) create a database owned by a particular user but without giving him/her the right to create databases (some users make mistakes, or bad things, whatever), and 2) keep consistent backups. I managed to do 1) by creating a database as a superuser, then changing the ownership directly into the pg_database table. The user owning the database is now able to create his/her tables/views/whatever, in this database only. Fine. But for 2), I noticed an inconsistency in the backup file, see below. The user that is the datdba has the same name ('sthomas') : ... -- -- Database sthomas -- \connect template1 sthomas CREATE DATABASE "sthomas" WITH TEMPLATE = template0 ENCODING = 'SQL_ASCII'; \connect sthomas sthomas ... This will fail in the case of a database reconstruction (after a crash for example), because this user is not authorized to create databases, right ? I think these lines should look like : \connect template1 postgres CREATE DATABASE "sthomas" WITH TEMPLATE = template0 ENCODING = 'SQL_ASCII'; UPDATE pg_database SET datdba = WHERE datname = 'sthomas' ; \connect sthomas sthomas Am I wrong ? Couldn't this be the "standard" pg_dump(|all) behaviour ? Nicolas. PS : I can edit manually the dump files, so this isn't really important.