Re: [COMMITTERS] pgsql: Add new catalog called pg_init_privs

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Stephen Frost <sfrost(at)snowman(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: [COMMITTERS] pgsql: Add new catalog called pg_init_privs
Date: 2016-04-15 19:18:36
Message-ID: 20160415191836.GA432999@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

Stephen Frost wrote:
> Add new catalog called pg_init_privs
>
> This new catalog holds the privileges which the system was
> initialized with at initdb time, along with any permissions set
> by extensions at CREATE EXTENSION time. This allows pg_dump
> (and any other similar use-cases) to detect when the privileges
> set on initdb-created or extension-created objects have been
> changed from what they were set to at initdb/extension-creation
> time and handle those changes appropriately.

If you have an extension that's marked not relocatable and drop it, its
schema is left behind; trying to create the extension again, *crash*.

$ cat /pgsql/install/master/share/extension/crash--1.sql
grant usage on schema @extschema@ to public;

$ cat /pgsql/install/master/share/extension/crash.control
comment = 'crash'
default_version = '1'
relocatable = false
superuser = true
schema = 'crash'

alvherre=# create extension crash;
CREATE EXTENSION
alvherre=# drop extension crash;
DROP EXTENSION
alvherre=# \dn
Listado de esquemas
Nombre | Dueño
--------+----------
crash | alvherre
public | alvherre
(2 filas)

alvherre=# create extension crash;
el servidor ha cerrado la conexión inesperadamente
Probablemente se debe a que el servidor terminó de manera anormal
antes o durante el procesamiento de la petición.
La conexión al servidor se ha perdido. Intentando reiniciar: con éxito.

--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Stephen Frost 2016-04-15 19:20:57 Re: [COMMITTERS] pgsql: Add new catalog called pg_init_privs
Previous Message Robert Haas 2016-04-15 18:04:35 Re: Re: [COMMITTERS] pgsql: Add trigonometric functions that work in degrees.

Browse pgsql-hackers by date

  From Date Subject
Next Message Stephen Frost 2016-04-15 19:20:57 Re: [COMMITTERS] pgsql: Add new catalog called pg_init_privs
Previous Message Simon Riggs 2016-04-15 19:18:31 Re: Suspicious behaviour on applying XLOG_HEAP2_VISIBLE.