Received: from news.tht.net (news.hub.org [216.126.91.242]) by postgresql.org (8.11.3/8.11.4) with ESMTP id fB5Kd8m98629; Wed, 5 Dec 2001 15:39:08 -0500 (EST) (envelope-from news@news.tht.net) Received: (from news@localhost) by news.tht.net (8.11.4/8.11.4) id fB5KNjY06574; Wed, 5 Dec 2001 15:23:45 -0500 (EST) (envelope-from news) From: "Yanek Korff" X-Newsgroups: comp.databases.postgresql.admin, comp.databases.postgresql.general Subject: duplicate templates, wrong users Date: Wed, 5 Dec 2001 15:23:42 -0500 Organization: Hub.Org Networking Services (http://www.hub.org) Lines: 66 Message-ID: <9ulvof$6db$1@news.tht.net> X-Complaints-To: scrappy@hub.org X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4807.1700 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4807.1700 To: pgsql-admin@postgresql.org.pgsql-general@postgresql.org X-Archive-Number: 200112/42 X-Sequence-Number: 2766 Well, a while ago I set up postgresql and have been using it for a small database ever since. I'm now looking at local authentication and permissions and a number of questions have come up. When I run select * from pg_database, I get this: datname | datdba | encoding | datistemplate | datallowconn | datlastsysoid | datpath ------------------+--------+----------+---------------+--------------+------ ---------+--------- db1 | 72 | 0 | f | t | 18539 | template1 | 72 | 0 | t | t | 18539 | template0 | 72 | 0 | t | f | 18539 | db2 | 73 | 0 | f | t | 18539 | db3 | 75 | 0 | f | t | 18539 | (I've replaced the names of the databases with db1, db2, and db3). here's pg_user: usename | usesysid | usecreatedb | usetrace | usesuper | usecatupd | passwd | valuntil ------------+----------+-------------+----------+----------+-----------+---- ------+---------- pgsql | 72 | t | t | t | t | ******** | os_user | 71 | t | f | t | t | ******** | user3 | 75 | f | f | f | f | ******** | user1 | 72 | f | f | f | f | ******** | user2 | 73 | f | f | f | f | ******** | where user1 should correspond to db1 etc. When I list my databases, it looks like this: List of databases Database | Owner ------------------+------------ db2 | user2 db1 | user1 db1 | pgsql template0 | pgsql template0 | user1 template1 | user1 template1 | pgsql db3 | user3 What's with the duplicate databases? Why does user1 own TEMPLATES? Clearly I have screwed something up. What's the proper way to fix it? As I see it, I should be able to create a user, create a database with that user... change that user to not be able to create databases, and then lock down the databases so other users cannot get in. This is possible, yes? I cannot find good documentation on this anywhere. Any help would be GREATLY appreciated. -Yanek.