Re: Getting rid of the flat authentication file - Mailing list pgsql-hackers

From Joshua D. Drake
Subject Re: Getting rid of the flat authentication file
Date
Msg-id 1251475471.27122.31.camel@jd-desktop.iso-8859-1.charter.com
Whole thread Raw
In response to Re: Getting rid of the flat authentication file  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Fri, 2009-08-28 at 11:52 -0400, Tom Lane wrote:

> I've thought of an easier way to handle this: if the given database name
> is invalid, connect to database "postgres" instead, and perform
> authentication using normal access to the pg_auth catalogs.  If
> authentication succeeds, *then* throw the error about nonexistent
> database.  If "postgres" is not there, we'd still expose existence
> of the original database name early, but how many installations don't
> have that? 

I run into it all the time. People drop the postgres database as not
needed.

>  (I thought about trying template1 and/or template0 as
> fallbacks, but that's probably not a good thing.  Backends that are
> waiting on a client for authentication would pose a DOS problem for
> sessions trying to do CREATE DATABASE, if they're connected to those.)

What if there was a silent database, say pg_authdb. That isn't even
visible under normal circumstances (need to be in single user mode)?

Alternatively just make it so the postgres database can't be dropped.

ERROR: The database postgres is a system database. It can not be
dropped.

Joshua D. Drake

-- 
PostgreSQL.org Major Contributor
Command Prompt, Inc: http://www.commandprompt.com/ - 503.667.4564
Consulting, Training, Support, Custom Development, Engineering




pgsql-hackers by date:

Previous
From: Josh Berkus
Date:
Subject: Re: [PATCH] DefaultACLs
Next
From: Peter Eisentraut
Date:
Subject: Re: Linux LSB init script