Re: Default privileges for new databases (was Re: Can't

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Rod Taylor <rbt(at)zort(dot)ca>, Ron Snyder <snyder(at)roguewave(dot)com>, Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Default privileges for new databases (was Re: Can't
Date: 2002-08-27 04:08:18
Message-ID: 18839.1030421298@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> So template1 is writable (yuck) only so databases created from template1
> are writeable to world by default. Is that accurate?

Yup.

I had a probably-harebrained idea about this: the writeability of public
is only a serious issue when it is the default creation-target schema.
It's likely that you'd say "create table foo" without reflecting about
the fact that you're connected to template1; much less likely that you'd
say "create table public.foo". So, what if the default per-database GUC
settings for template1 include setting the search_path to empty? That
would preclude accidental table creation in template1's public schema.
As long as CREATE DATABASE doesn't copy the per-database GUC settings of
the template database, copied databases wouldn't be similarly crippled.

Now I'm not entirely convinced that CREATE DATABASE shouldn't copy the
per-database GUC settings of the template. But at the moment it
doesn't, and if we're willing to institutionalize that behavior then
it'd provide a way out.

Or is that too weird?

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2002-08-27 04:09:38 Re: Use of LOCAL in SET command
Previous Message Bruce Momjian 2002-08-27 04:02:02 Re: Use of LOCAL in SET command