FAQ
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'
LANGUAGE c;

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

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppgsql-hackers @
categoriespostgresql
postedMay 25, '04 at 3:43a
activeMay 25, '04 at 3:43a
posts1
users1
websitepostgresql.org...
irc#postgresql

1 user in discussion

Christopher Kings-Lynne: 1 post

People

Translate

site design / logo © 2022 Grokbase