pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Bruno Wolff III <bruno@wolff.to>
Cc: Bruce Momjian <bruce@momjian.us>
Cc: Thomas Kellerer <shammat@gmx.net>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: Postgres 15 upgrades and template1 public schema
Date: Wed, 19 Oct 2022 19:59:52 -0400
Message-ID: <2949522.1666223992@sss.pgh.pa.us> (raw)
In-Reply-To: <20221019224828.GA11721@wolff.to>
References: <20221019203602.GA6563@wolff.to>
	<54d740ed-1158-c8d4-4cae-15c06e95c9e6@gmx.net>
	<20221019224828.GA11721@wolff.to>

Bruno Wolff III <bruno@wolff.to> writes:
> On Wed, Oct 19, 2022 at 23:30:58 +0200,
>   Thomas Kellerer <shammat@gmx.net> wrote:
>> This is explained in the release notes:
>> 
>> The change applies to new database clusters and to newly-created
>> databases in existing clusters.
>> Upgrading a cluster or restoring a database dump will preserve
>> public's existing permissions.

> How do new databases in pre-existing clusters get the new public schema 
> security if it doesn't come from template1?

The release notes could probably use some tweaking here.  It looks to
me like pg_dumpall (and hence pg_upgrade) will adjust the ownership and
permissions of template1's public schema to match what was in the old
installation, but it doesn't touch template0.  Hence, whether a
"newly-created database in an existing cluster" has the old or new
properties of the public schema will depend on whether you clone it
from template1 or template0.  That definitely needs explained, and
maybe we should recommend that DBAs consider manually changing
what's in template1.

			regards, tom lane





view thread (6+ messages)  latest in thread

Message-ID: <2949522.1666223992@sss.pgh.pa.us>
Permalink:  ../2949522.1666223992@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/2949522.1666223992@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: tgl@sss.pgh.pa.us, bruno@wolff.to, bruce@momjian.us, shammat@gmx.net
  Subject: Re: Postgres 15 upgrades and template1 public schema
  In-Reply-To: <2949522.1666223992@sss.pgh.pa.us>
  References: <20221019203602.GA6563@wolff.to> <54d740ed-1158-c8d4-4cae-15c06e95c9e6@gmx.net> <20221019224828.GA11721@wolff.to> <2949522.1666223992@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox