RE: GRANT CREATE or ALTER SCHEMA?

From: "Moradhassel, Kavian" <kmoradha(at)ciena(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "pgsql-admin(at)lists(dot)postgresql(dot)org" <pgsql-admin(at)lists(dot)postgresql(dot)org>
Subject: RE: GRANT CREATE or ALTER SCHEMA?
Date: 2018-03-22 15:03:50
Message-ID: MWHPR04MB062500D28FA71A0CAF22A360C2A90@MWHPR04MB0625.namprd04.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Thanks for the quick response, Tom!

Kav Moradhassel | R&D Tools and Metrics | Ciena
kmoradha(at)ciena(dot)com | 385 Terry Fox Drive | Ottawa, ON, K2K 0L1  Canada

-----Original Message-----
From: Tom Lane [mailto:tgl(at)sss(dot)pgh(dot)pa(dot)us]
Sent: March 22, 2018 11:01 AM
To: Moradhassel, Kavian <kmoradha(at)ciena(dot)com>
Cc: pgsql-admin(at)lists(dot)postgresql(dot)org
Subject: Re: GRANT CREATE or ALTER SCHEMA?

"Moradhassel, Kavian" <kmoradha(at)ciena(dot)com> writes:
> We understand why the public schema is owned by the "postgres" account
> to start with, i.e. because CREATE DATABASE copies from the template1
> database.

Right.

> Changing the owner of the public schema to the database owner after
> database creation (i.e. #1 above) seems to be the simplest approach, but
> we're wondering if there's a reason for the public schema to be owned by
> the postgres account, i.e. beyond just "this is how it happens by
> default". We can't come up with one, and neither can our Google-fu. :-)

No, there isn't another reason, really. There have actually been
proposals to change the behavior of CREATE DATABASE to adjust the
ownership of that schema automatically. But it's not simple to do
from within the creating session, and there'd be backwards-compatibility
complaints anyway.

regards, tom lane

Browse pgsql-admin by date

  From Date Subject
Next Message Debraj Manna 2018-03-22 16:02:56 Number of updated rows in postgres
Previous Message Tom Lane 2018-03-22 15:00:58 Re: GRANT CREATE or ALTER SCHEMA?