BUG #18383: creation of public schema is not consistent - Mailing list pgsql-bugs

From PG Bug reporting form
Subject BUG #18383: creation of public schema is not consistent
Date
Msg-id 18383-d93f1e992237a8fd@postgresql.org
Whole thread Raw
Responses Re: BUG #18383: creation of public schema is not consistent  (Sam Darwin <samuel.d.darwin@gmail.com>)
Re: BUG #18383: creation of public schema is not consistent  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
The following bug has been logged on the website:

Bug reference:      18383
Logged by:          Sam Darwin
Email address:      samuel.d.darwin@gmail.com
PostgreSQL version: 15.2
Operating system:   Ubuntu 22.04
Description:

Hi,

This is somewhere in-between a feature request and a bug. 

When you create a database, the public schema has a description "standard
public schema", by default.

If you drop and re-create the public schema, it has an empty description.

These two activities are pretty similar.  Creating a database. Creating a
public schema.  But the results are different.  You might imagine, that's
not particularly important. It doesn't affect anything.  However, the
absence of that description "standard public schema" can cause errors during
a backup and restore procedures.  Why?  Because re-setting the schema
description during a restoration, requires that you must be the "owner" of
the schema. It's not enough to have full permissions. The restoring user
account might have all permissions, except not be the "owner" of the public
schema, and that will cause the restore to have an error. 

What is a solution? Either always set the description of the public schema
to ""standard public schema", or never set the description of the public
schema to "standard public schema".  Or allow restoration of the
"description" from a backup.     
Or, leave it as is, so that a person encountering the error must do a lot of
investigation.  :-)   Ok.


pgsql-bugs by date:

Previous
From: Alexander Korotkov
Date:
Subject: Re: BUG #18212: Functions txid_status() and pg_xact_status() return invalid status of the specified transaction
Next
From: Sam Darwin
Date:
Subject: Re: BUG #18383: creation of public schema is not consistent