Did we intend to change whether PUBLIC can create tables in the public schema by default?

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Did we intend to change whether PUBLIC can create tables in the public schema by default?
Дата
Msg-id CAKFQuwai+y40XzzMhDsz8ctY86Csa+r-N+JeMOOKVXViYk8upg@mail.gmail.com
обсуждение исходный текст
Ответы Re: Did we intend to change whether PUBLIC can create tables in the public schema by default?  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список pgsql-hackers
Hey,

For the following sequence of commands, on a newly initdb v15devel and mostly clean v13 I get a failure and a created table respectively.

Showing v15devel:

postgres=# create database testdb;
CREATE DATABASE
postgres=# create role testrole;
CREATE ROLE
postgres=# \c testdb
You are now connected to database "testdb" as user "vagrant".
testdb=# set session authorization testrole;
SET
testdb=> create table public.testtable(id int);
ERROR:  permission denied for schema public
LINE 1: create table public.testtable(id int);
testdb=> select version();
                                                 version
----------------------------------------------------------------------------------------------------------
 PostgreSQL 15devel on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0, 64-bit
(1 row)


=======================================================================================
v13.6  (I also have a report this is the behavior of v14)

postgres=# create database testdb;
crCREATE DATABASE
postgres=# create role testrole;
CREATE ROLE
postgres=# \c testdb
You are now connected to database "testdb" as user "postgres".
testdb=# select version();
                                                             version
----------------------------------------------------------------------------------------------------------------------------------
 PostgreSQL 13.6 (Ubuntu 13.6-1.pgdg20.04+1) on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0, 64-bit
(1 row)

testdb=# set session authorization testrole;
SET
testdb=> create table public.testtable (id int);
CREATE TABLE


David J.

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Atomic GetFreeIndexPage()?
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: Did we intend to change whether PUBLIC can create tables in the public schema by default?