Re: Getting rid of the flat authentication file

From: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Getting rid of the flat authentication file
Date: 2009-08-28 16:04:31
Message-ID: 1251475471.27122.31.camel@jd-desktop.unknown.charter.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2009-08-28 16:12:10 Re: Getting rid of the flat authentication file
Previous Message Alvaro Herrera 2009-08-28 15:55:50 Re: [PATCH] Largeobject access controls