Dump problems with superusers
От | Christopher Kings-Lynne |
---|---|
Тема | Dump problems with superusers |
Дата | |
Msg-id | 40B2C23F.7050509@familyhealth.com.au обсуждение исходный текст |
Список | pgsql-hackers |
Hi, There are several objects in PostgreSQL that you can only create if you are a superuser, eg. procedural languages. If you do this, you break the dump: 1. create a superuser 2. install a language as that superuser 3. drop the superuser privs from that superuser 4. dump the database 5. attempt to restore the database It fails because this is what gets dumped: CREATE USER test WITH SYSID 100 NOCREATEDB NOCREATEUSER; ... SET SESSION AUTHORIZATION 'test'; CREATE FUNCTION plpgsql_call_handler() RETURNS language_handler AS '$libdir/plpgsql', 'plpgsql_call_handler' LANGUAGEc; CREATE FUNCTION plpgsql_validator(oid) RETURNS void AS '$libdir/plpgsql', 'plpgsql_validator' LANGUAGE c; SET SESSION AUTHORIZATION DEFAULT; CREATE TRUSTED PROCEDURAL LANGUAGE plpgsql HANDLER plpgsql_call_handler VALIDATOR plpgsql_validator; Now it cannot restore the dump as the 'test' user no longer has permissions to do so. Chris
В списке pgsql-hackers по дате отправления: