Обсуждение: BUG #7741: Two bugs when backing up databases with default privileges defined on public schema

Поиск
Список
Период
Сортировка

BUG #7741: Two bugs when backing up databases with default privileges defined on public schema

От
me@nathanalden.com
Дата:
The following bug has been logged on the website:

Bug reference:      7741
Logged by:          Nathan Alden, Sr.
Email address:      me@nathanalden.com
PostgreSQL version: 9.2.2
Operating system:   Windows 7 x64
Description:        =


- Create new group role called my_group with default settings
- Create a new database called test_database with default settings
- Run the following SQL:

alter default privileges in schema public grant all on tables to my_group;
alter default privileges in schema public grant all on functions to
my_group;
alter default privileges in schema public grant all on sequences to
my_group;
alter default privileges in schema public grant all on types to my_group;

- Using pgAdmin III, backup the test_database database using the plain
format and note the error. Here's the log:

C:/Program Files/PostgreSQL/9.2/bin\pg_dump.exe --host localhost --port 5432
--username "postgres" --no-password  --format plain --verbose --file
"D:\Databases\PostgreSQL Backups\test_database.backup" "test_database"
pg_dump: reading schemas
pg_dump: reading user-defined tables
pg_dump: reading extensions
pg_dump: reading user-defined functions
pg_dump: reading user-defined types
pg_dump: reading procedural languages
pg_dump: reading user-defined aggregate functions
pg_dump: reading user-defined operators
pg_dump: reading user-defined operator classes
pg_dump: reading user-defined operator families
pg_dump: reading user-defined text search parsers
pg_dump: reading user-defined text search templates
pg_dump: reading user-defined text search dictionaries
pg_dump: reading user-defined text search configurations
pg_dump: reading user-defined foreign-data wrappers
pg_dump: reading user-defined foreign servers
pg_dump: reading default privileges
pg_dump: reading user-defined collations
pg_dump: reading user-defined conversions
pg_dump: reading type casts
pg_dump: reading table inheritance information
pg_dump: reading rewrite rules
pg_dump: finding extension members
pg_dump: finding inheritance relationships
pg_dump: reading column info for interesting tables
pg_dump: flagging inherited columns in subtables
pg_dump: reading indexes
pg_dump: reading constraints
pg_dump: reading triggers
pg_dump: reading large objects
pg_dump: reading dependency data
pg_dump: saving encoding =3D UTF8
pg_dump: saving standard_conforming_strings =3D on
pg_dump: saving database definition
pg_dump: unknown object type (84) in default privileges

Process returned exit code 1.

- Again in pgAdmin III, right-click the public schema and choose Properties
- Navigate to the Default Privileges tab and note how no default privileges
show up, even though they are present
me@nathanalden.com writes:
> alter default privileges in schema public grant all on types to my_group;
> [ leads to ]
> pg_dump: unknown object type (84) in default privileges

Hmm ... looks like whoever added GRANT ON TYPES did a pretty half-baked
job.  Will look into it --- thanks for the report!

> - Again in pgAdmin III, right-click the public schema and choose Properties
> - Navigate to the Default Privileges tab and note how no default privileges
> show up, even though they are present

This may be a consequence of the other problem, but in case it isn't,
you should report it on the pgadmin mailing list.  pgsql-bugs generally
just deals with bugs in the core Postgres distribution.

            regards, tom lane
I wrote:
> me@nathanalden.com writes:
>> alter default privileges in schema public grant all on types to my_group;
>> [ leads to ]
>> pg_dump: unknown object type (84) in default privileges

> Hmm ... looks like whoever added GRANT ON TYPES did a pretty half-baked
> job.  Will look into it --- thanks for the report!

Ugh ... there were more creepy-crawlies under that rock than I expected.
I've squashed a bunch of them:
http://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=6cb8c6043ee47ced46da131bc0705e9c4bdd8667
but I wouldn't really want to bet that I didn't miss anything.  If you
have the ability to apply patches locally, please apply that one and
keep testing.  If not, I'd recommend staying away from datatype
privileges until 9.2.3 is out ...

            regards, tom lane