Re: Schemas and template1

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL-development <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: Schemas and template1
Date: 2002-06-12 03:44:43
Message-ID: 200206120344.g5C3ih824901@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-interfaces

Tom Lane wrote:
> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > How about if we hard-wire template1 as being no-write to public
> > somewhere in the code, rather than in the db tables?
>
> Seems pretty icky :-(
>
> It occurs to me that maybe we don't need to worry. The main reason why
> we've offered the advice "don't fill template1 with junk" in the past
> is that it was so hard to clear out the junk without zapping built-in
> entries. But now, you really have to work hard at it to shoot yourself
> in the foot that way. If you created junk in template1.public, no
> sweat:
> \c template1 postgres
> DROP SCHEMA public;
> CREATE SCHEMA public;
> -- don't forget to set its permissions appropriately
> (This assumes we get DROP SCHEMA implemented in time for 7.3, but
> I think we can build that based on Rod's pg_depend stuff.) (Which
> I really really gotta review and apply soon.)
>
> I'm of the opinion that template1 and public are not very special
> at the moment; the C-level code doesn't think either of them are
> special, which is why you can drop and recreate them if you have to.
> We should try not to re-introduce any low-level specialness.

It is strange we have to allow template1 open just for client stuff. I
would really like to lock it down read-only. I guess we can tell admins
to lock down public in template1, and all newly created databases will
be the same.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2002-06-12 04:02:26 Re: Analyze on large changes...
Previous Message Tom Lane 2002-06-12 03:42:28 Re: Schemas and template1

Browse pgsql-interfaces by date

  From Date Subject
Next Message Michael Meskes 2002-06-12 12:34:07 Re: How to use embedded sql to define an array
Previous Message Tom Lane 2002-06-12 03:42:28 Re: Schemas and template1